Socket
Socket
Sign inDemoInstall

@subsocial/resource-discussions

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@subsocial/resource-discussions

Support tool for work with resource-discussions pallet


Version published
Maintainers
4
Created
Source

Subsocial helper for resource-discussions pallet by DappForce

SocialResource is meant to make work with resource-discussions pallet easier. Main goals of this tool:

  • convert resource parameters from object tree view to resourceId string;
  • keep resourceId structure stable and fixed;
  • validate resource parameters object;

Usage example:

import { SocialResource, ResourceParameters } from '@subsocial/resource-discussions'

const resourceParams: ResourceParameters = {
  schema: 'chain',
  chainType: 'substrate',
  chainName: 'xsocial',
  resourceType: 'block',
  resourceValue: {
    blockNumber: '3219502'
  }
}

const resourceInstance = new SocialResource(resourceParams)

const resourceId = resourceInstance.toResourceId()

Types and parameters

ResourceParameters object has sequentially conditional structure. It means, that parameter schema or specific combination of parameters chema and chainType influences to valid combination of further parameters. This flow is controlled by graph-based config structure and TypeScript types. You can investigate all possible parameters combinations in package types.

Keywords

FAQs

Package last updated on 11 Oct 2023

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc