Cooler MetaID
What is this?
Cooler MetaID is a RESTful-like domain protocol based on Microvision Chain and MetaID DID protocol. Developers can use Cooler MetaID to create his own domain resource.
How to use?
The API examples listed here are still under development.
Define domain
import { define, use } from '@metaid/cooler-metaid'
const Buzz = define('buzz', {
})
const Buzz = use('buzz')
const GroupMessage = use('group-message')
Use domain
const buzzes = Buzz.list()
const buzzes = Buzz.list({
where: {
title: 'Hello World',
},
})
await Buzz.login('0x1234567890')
await Buzz.logout()
Buzz.login('0x1234567890')
const myBuzzes = Buzz.myList()
Buzz.login('0x1234567890')
const hasRoot: boolean = Buzz.hasRoot()
Buzz.login('0x1234567890')
await Buzz.hasRoot()
const buzz = Buzz.one('0x1234567890')
const buzz = Buzz.first('0x1234567890')
const buzz = Buzz.get('0x1234567890')
const buzz = Buzz.one({
where: {
title: 'Hello World',
},
})
const newBuzz = Buzz.create({
title: 'Hello World',
content: 'This is my first buzz',
})
const updatedBuzz = Buzz.update('0x1234567890', {
title: 'Hello World',
content: 'This is my first buzz',
})
const oldBuzz = Buzz.get('0x1234567890')
const updatedBuzz = oldBuzz.update({
title: 'Hello World',
content: 'This is my first buzz',
})
const deletedBuzz = Buzz.delete('0x1234567890')
oldBuzz.delete()