0.2.0 • Published 4 months ago

@ethda/blobs v0.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Usage

Install

npm install @ethda/blobs

Upload blobs

import {BlobClient, EncodeBlobs} from '@ethda/blobs';
import {ethers} from "ethers";

const content = 'abc....';
const blobs = EncodeBlobs(Buffer.from(content, 'utf-8'));

const signer = new ethers.Wallet('<private_key>', new ethers.providers.JsonRpcProvider("https://rpc.ethda.io"));
const blobClient = new BlobClient(signer);
const hash = await blobClient.sendTx(blobs)
const receipt = await blobClient.getTxReceipt(hash)

Download blobs

import { BlobClient, EncodeBlobs } from '@ethda/blobs';

const txHash = '...';
const blobClient = new BlobClient(new ethers.providers.JsonRpcProvider("https://rpc.ethda.io"));
const result = await blobTrans.downloadBlobs(txHash)
/**
**  result: {
 blob_hashes: ['0x01853e6b060f5b155f406a7ca3f912df5f93873d9df56ad31904db846565dbd2'],
 sidecar: { blobs: [ [Array] ], commitments: [ [Array] ], proofs: [ [Array] ] }}
 **
*/

Publish to npmjs

$ npm login --registry=https://registry.npmjs.org
$ npm whoami
# Publish package via `np` command (Version number in package.json will be auto updated and committed).
$ yarn np [1.0.0]

Development

Install Dependencies

$ yarn

Build

Lint

$ yarn lint

Auto fix lint errors

$ yarn fix
0.2.0

4 months ago

0.1.8

4 months ago

0.1.7

4 months ago

0.1.9

4 months ago

0.1.4

4 months ago

0.1.6

4 months ago

0.1.5

4 months ago

0.1.3

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago

0.0.0

4 months ago