Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@godeners/things

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@godeners/things

Things is a library for MetaID protocol. It provides a set of functions to manage the DID document and the DID transaction.

  • 0.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Things

What is this?

Things is a RESTful-like domain protocol based on Microvision Chain and MetaID DID protocol. Developers can use Things to create his own domain resource.

How to use?

The API examples listed here are still under development.

Define domain

import { define, use } from '@godeners/things'

// define api returns a class represents what the domain is.
const Buzz = define('buzz', {
  //...
})

// use api returns a class represents what the domain is. (using existing domain)
const Buzz = use('buzz')

Use domain

// list
const buzzes = Buzz.list()

// list filtered by query
const buzzes = Buzz.list({
  where: {
    title: 'Hello World',
  },
})

// my list
Buzz.login('0x1234567890') // metaid or address
const myBuzzes = Buzz.myList()

// has container
Buzz.login('0x1234567890') // metaid or address
const hasRoot: boolean = Buzz.hasContainer()

// create container
Buzz.login('0x1234567890') // metaid or address
await Buzz.createContainer()

// get one
const buzz = Buzz.one('0x1234567890') // txid
const buzz = Buzz.first('0x1234567890') // or use alias `first`
const buzz = Buzz.get('0x1234567890') // ...or `get`
const buzz = Buzz.one({
  where: {
    title: 'Hello World',
  },
})

// create
const newBuzz = Buzz.create({
  title: 'Hello World',
  content: 'This is my first buzz',
})

// update
const updatedBuzz = Buzz.update('0x1234567890', {
  title: 'Hello World',
  content: 'This is my first buzz',
})
// or update one existing resource
const oldBuzz = Buzz.get('0x1234567890')
const updatedBuzz = oldBuzz.update({
  title: 'Hello World',
  content: 'This is my first buzz',
})

// delete
const deletedBuzz = Buzz.delete('0x1234567890')
// or delete one existing resource
oldBuzz.delete()

Keywords

FAQs

Package last updated on 25 Aug 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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc