Quick Reference
info
Here is a collection of the most commonly used methods within Subsocial SDK. For more in-depth look into this library, please reference the TypeDocs.
#
Setup#
InstallAdd type definitions and utils library:
#
Import#
Configuration- TestNet
- MainNet
- LocalNet
caution
Make sure to run local Subsocial & IPFS node before using these configs in your project.
#
Reading Data#
SpaceSpace is the place where all content on SubSocial lives. It holds multiple posts from different people depending upon the permission. Read More
- By Id
- By Owner
- By Handle
Check full docs here.
#
PostPost is the piece of content that provides value for the readers. It can be some written text, an image, or a video. Read More
- By Id
- By Space Id
Check full docs here.
#
ProfileProfile is linked to your Subsocial account address, and is an overview of your activity on Subsocial. You can set a profile picture and a username for your account, as well as a personal website link. Read More
- Single Account
- Multiple Accounts
Check full docs here.
#
Writing Data#
SpaceAdd following import statement:
Storing space details in IPFS, and generating a CID.
Creating a Space transaction object
- Create Space
- Update Space
Signing a transaction and sending to blockchains
Check full docs here.
#
PostAdd following import statement:
Storing post details in IPFS, and generating a CID.
Creating a post transaction object
- Regular Post
- Shared Post
- Update Post
Signing a transaction and sending to blockchain
Check full docs here.
#
ProfileAdd the following import statement:
Storing profile details in IPFS, and generating a CID to add on blockchain:
Creating profile transaction object:
- Create Profile
- Update Profile
Signing a transaction and sending to blockchain
Check full docs here.
#
CommentsComments are replies to a post that are visible below a post.
#
Reading Comments#
Writing Comments- Create Profile
- Update Profile
Check full docs here.
#
Follows#
Check if followerThis checks if an account is following a particular space.
- Is Space Follower
- Is Account Follower
#
Fetch list of followers#
For Spaces- By Space Id
- Followed by Account Id
#
For Accounts- Followers
- Following
Check full docs here.
#
Follow / Unfollow#
For Spaces- Follow
- Unfollow
Signing a transaction and sending to blockchain
#
For Accounts- Follow
- Unfollow
Signing a transaction and sending to blockchain
Check full docs here.
#
ReactionsReactions are your signs to Upvote
or Downvote
a post.
#
Get all reactions- Single Reaction
- Multiple Reactions
#
Reacting to a post- Create
- Update
- Delete
Signing a transaction and sending to blockchain
Check full docs here.