@cuser/core
Status
Class: ClientCorePubSub
Creates pubsub to listen changes on cuser network
Hierarchy
- ClientCorePubSub
Index
Constructors
Methods
Constructors
constructor
+ new ClientCorePubSub(node
: IPFSAPI | Promise<IPFSAPI>, opts
: CuserClientPubSubOptions): ClientCorePubSub
Defined in pubsub.js:72
Parameters:
Name | Type |
---|---|
node |
IPFSAPI | Promise<IPFSAPI> |
opts |
CuserClientPubSubOptions |
Returns: ClientCorePubSub
Methods
broadcast
▸ broadcast(payload
: any): void
Defined in pubsub.js:101
Parameters:
Name | Type | Description |
---|---|---|
payload |
any |
Returns: void
subscribe
▸ subscribe(subscriber
: (payload: Object) => void): (Anonymous function)
Defined in pubsub.js:107
Parameters:
Name | Type | Description |
---|---|---|
subscriber |
(payload: Object) => void |
Returns: (Anonymous function)
Class: CuserCore
Core logic to manage the dag tree and specify the dag format, this will wraps ipfs.dag in order to normalize the mainly used methods and allows future replacements.
Hierarchy
- CuserCore
Index
Constructors
Methods
Constructors
constructor
+ new CuserCore(node
: IPFSAPI | Promise<IPFSAPI>, opts
: CuserCoreOptions): CuserCore
Defined in core.js:28
Parameters:
Name | Type |
---|---|
node |
IPFSAPI | Promise<IPFSAPI> |
opts |
CuserCoreOptions |
Returns: CuserCore
Methods
get
▸ get(cid
: string, opts
: AbortOptions): Promise<any>
Defined in core.js:91
Parameters:
Name | Type |
---|---|
cid |
string |
opts |
AbortOptions |
Returns: Promise<any>
peerId
▸ peerId(): Promise<string>
Defined in core.js:119
Gets the node peerId
Returns: Promise<string>
publish
▸ publish(cid
: string, opts
: AbortOptions): Promise<PublishResult>
Defined in core.js:56
Publish using ipns to link the current cid to a fixed entry
Parameters:
Name | Type |
---|---|
cid |
string |
opts |
AbortOptions |
Returns: Promise<PublishResult>
pubsub
▸ pubsub(opts
: CuserClientPubSubOptions): ClientCorePubSub
Defined in core.js:128
Parameters:
Name | Type |
---|---|
opts |
CuserClientPubSubOptions |
Returns: ClientCorePubSub
put
▸ put(value
: any, opts
: AbortOptions & PutOptions): Promise<string>
Defined in core.js:75
Parameters:
Name | Type |
---|---|
value |
any |
opts |
AbortOptions & PutOptions |
Returns: Promise<string>
resolve
▸ resolve(cid
: string | Promise<string>): Promise<string>
Defined in core.js:106
Resolve the linked dag cid
Parameters:
Name | Type |
---|---|
cid |
string | Promise<string> |
Returns: Promise<string>