matrixesports / ceratosaur

☄️ Wrapper for interact with the Ceramic Network API in Deno (WIP)

Home Page:https://deno.land/x/ceratosaur

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ceratosaur ☄️

Ceratosaur is a Wrapper for interact with the Ceramic Network HTTP API

Get it from 🦕 deno.land or nest.land 🥚

Example

Ceratosaur is built in a way that you can use as you like, you can use the base functions, specify the database URL, or use the ceramic function.

Get Stream

With ceramic

import { ceramic } from "https://deno.land/x/ceratosaur/mod.ts";

const database = ceramic("http://localhost:7007");

// this automatically concatenates the url with /api/v0/streams
ceramic.getStream(
	"k2t6wyfsu4pg2qvoorchoj23e8hf3eiis4w7bucllxkmlk91sjgluuag5syphl",
);

with getStream function

import { getStream } from "https://deno.land/x/ceratosaur/mod.ts";

// you need specify /api/v0/streams
getStream(
	"http://localhost:7007/api/v0/streams",
	"k2t6wyfsu4pg2qvoorchoj23e8hf3eiis4w7bucllxkmlk91sjgluuag5syphl",
);

Create stream

With ceramic

import { ceramic } from "https://deno.land/x/ceratosaur/mod.ts";

const database = ceramic("http://localhost:7007");

const awesomeStream = ceramic.createStream();
console.log(awesomeStream.streamId);

with createStream function

import { createStream } from "https://deno.land/x/ceratosaur/mod.ts";

const awesomeStream = createStream("http://localhost:7007/api/v0/streams");
console.log(awesomeStream.streamId);

Useful Links

Documentation

About

☄️ Wrapper for interact with the Ceramic Network API in Deno (WIP)

https://deno.land/x/ceratosaur


Languages

Language:TypeScript 100.0%