New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blocklet/sdk

Package Overview
Dependencies
Maintainers
2
Versions
741
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocklet/sdk

graphql client to read/write data on abt node

  • 1.3.6
  • npm
  • Socket score

Version published
Weekly downloads
3.3K
increased by196.5%
Maintainers
2
Weekly downloads
 
Created
Source

@blocklet/sdk

Blocklet SDK for blocklet developer

Install

yarn add @blocklet/sdk

or

npm install @blocklet/sdk

Auth SDK

Usage

const Auth = require('@blocklet/sdk/service/auth');

const client = new Auth();

const userDid = 'xxxxxxxx';

const { user } = await client.getUser(userDid);

Api

client.getUser(did)

Get user by user did

  • did string
client.getUsers()

Get all users of the team

client.updateUserRole(did, role)
  • did string
  • role string
client.getPermissionsByRole(role)

Get all permissions of a role

  • role string
client.getRoles()

Get all roles of the team

client.getPermissions()

Get all permissions of the team

Notification SDK

Usage

const Notification = require('@blocklet/sdk/service/notification');

const userDid1 = 'xxxxxxxx';
const userDid2 = 'xxxxxxxx';
const type = 'text';
const content = { message: 'this is a message' };
const actions = [{ name: 'xxx', title: 'Go To Website', link: 'https://arcblock.io' }];

await Notification.sendToUser(userDid1, type, content, { actions });

await Notification.sendToUsers([userDid1, userDid2], type, content, { actions });

Api

notification.sendToUser(did, type, content, options)

Send notification to an account

  • did string required
  • type enum 'text', 'asset', 'vc', 'token' required
  • content object
    • type: text
      • type string
      • message string
    • type: asset
      • did string did
      • chainHost string uri
      • chainId string
    • type: vc
      • credential object
      • tag string
    • type: token
      • address string did
      • amount string
      • symbol string
      • senderDid string did
      • chainHost string
      • chainId string
  • options object
    • actions array<object>
      • name string required
      • title string
      • color string
      • bgColor string
      • link string uri
notification.sendToUsers(didList, type, content, actions)

Send notification to multiple accounts

  • didList array<string> required
  • type Same as notification.sendToUser
  • content Same as notification.sendToUser
  • options Same as notification.sendToUser

FAQs

Package last updated on 14 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc