Skip to content

An API for use with the gasless conviction voting service

Notifications You must be signed in to change notification settings

topocount/conviction-voting-sdk

Repository files navigation

Gasless Conviction Voting Client SDK

Background

This SDK is for use with the Gasless Conviction Service. It abstracts away the details of interacting with the service and Ceramic to create and update user docs, and retrieve the global state document and the documents it references.

Getting Started

Install the package in your webapp

npm i @topocount/gasless-conviction-sdk

Then import the class and use it to interact with ceramic and the service:

// index.js
import {CvApi} from "@topocount/gasless-conviction-sdk";
{
  // some async scope
  const cvApi = await CvApi.from({
    ceramic,
    serviceURI: "https://myCVService.io",
  });
}

See api.ts for inline api documentation.

Lifecycle Details

Currently, there is no way to delete proposals from the global state document using the SDK. This is still an undeveloped lifecycle, since it requires some compromise on decentralization. Ideas and feedback are welcome.

For now, frontend developers can implement policies that filter out proposals based on some combination of:

  • trigger state
  • age
  • proposer

About

An API for use with the gasless conviction voting service

Resources

Stars

Watchers

Forks

Packages

No packages published