npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ucom-libs-social-transactions

v1.4.0

Published

NPM package to sign UOS transactions

Downloads

28

Readme

U°OS Application Transactions

Warning: this library has been deprecated

Please see this library: ucom.libs.wallet

Goal

This package is used to generate signed transactions related to different users actions.

Content type dictionary

number | description --- | --- 1 | Media post 2 | Post-offer 10 | Direct post (like a comment directly on user or on org) 11 | Repost of other post 3 | Comment 4 | Organization (Community)

Interaction type dictionary

number | description --- | --- 1 | Follow 5 | Unfollow 2 | Upvote (like) 4 | Downvote (dislike) 3 | Join (to the post-offer) 20 | Organization team invitation. Not implemented yet

Action name dictionary

name | description --- | --- usertouser | User to user interaction, for ex. follow makecontent | User makes content by himself (not by organization) makecontorg | Organization (organization member) makes content usertocont | User to content interaction, for ex. upvote dirpost | User creates direct post on other user dirpostorg | User creates direct post on organization

Workflow

  1. Call one of the methods and receive signed transaction.
  2. Send this transaction as is to backend server. Backend server will push this transaction to blockchain. Example:
body = {
// other request params
'signed_transaction': signed_transaction_string,
// other request params
}

How to install:

npm i git+ssh://[email protected]/gravityprotocol/uos.app.transaction.git#latest

User to user transactions

User follows other user

const { TransactionFactory } = require('uos-app-transaction');

// Init for test env before doing any calls
TransactionFactory.initForTestEnv();
// In production call this method instead: TransactionFactory.initForProductionEnv(); 

(async () => {

  const senderAccountName = 'vlad';
  const senderActivePrivateKey = accountsData.vlad.activePk;
  const recipientAccountName = 'jane';

  const signed = await TransactionFactory.getSignedUserFollowsUser(
    senderAccountName,
    senderActivePrivateKey,
    recipientAccountName
  );
  
  const signed_transaction_string = JSON.stringify(signed);
  // Then send this value in request body
})();

See also CONTRIBUTING for detailed project information.