0.1.6 • Published 1 year ago

point-demo-ts v0.1.6

Weekly downloads
-
License
(Apache-2.0 OR MI...
Repository
-
Last release
1 year ago

ComposeDB points

Installation

npm i point-demo-ts

Creating a Client

A hosted endpoint has already been provided for you. Simply initiate your client with a private seed from your environment variables.

For example:

import { PointClaimsClient } from "point-demo-ts";
//dummy seed below
PRIVATE_SEED='664c220e3edb28de62222bcb77fcfb158dc2403362fbef8e78a09335242ea38c'

const client = new PointClaimsClient(PRIVATE_SEED)

Creating a Point

Issuing a point will take in the following type:

type PointInput = {
  recipient: string;
  context: string;
  value: number;
  refId?: string;
};

For example:

const input = {
recipient: "did:pkh:eip155:1:0xc362c16a0dcbea78fb03a8f97f56deea905617bb",
context: "This is dummy context",
value: 10,
refId: "k2t6wzhkhabz3a7xz88mk93y1q2waejk1w2b5rs3kc82e42dgpe4l1h4mcibih",
};

const newPoint = await client.createPoint(input);
console.log(newPoint) /* will log the Ceramic document you just created in the following format:

type PointClaim = {
  id: string;
  issuer: {
    id: string;
  };
  recipient: {
    id: string;
  };
  data: {
    value: number;
    timestamp: string;
    context: string;
    refId: string;
  }[];
};

*/

License

Apache-2.0 OR MIT

0.1.6

1 year ago

0.1.5

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago