0.0.3 • Published 8 months ago

@zkmelabs/storage-sdk-js v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

zkMe Chain Storage SDK

The SDK is used to write applications that interact with the zkMe Chain Storage.

Installation

pnpm add @zkmelabs/storage-sdk-js

# or
yarn add @zkmelabs/storage-sdk-js

# or
npm install @zkmelabs/storage-sdk-js

Getting Started

uploadObject()

import { Storage } from '@zkmelabs/storage-sdk-js'

const storage = new Storage(
  'http://testnet-rpc.mechain.tech',
  5151
)

await storage.uploadObject({
  bucketName: 'Your bucket name',
  objectName: 'Your file name',
  body: fileBuffer
}, {
  type: 'ECDSA',
  privateKey: 'Your private key'
})

downloadFile()

import { Storage } from '@zkmelabs/storage-sdk-js'

const storage = new Storage(
  'http://testnet-rpc.mechain.tech',
  5151
)

const file = await storage.downloadFile({
  bucketName: 'Your bucket name',
  objectName: 'Your file name'
}, {
  type: 'ECDSA',
  privateKey: 'Your private key'
})
0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

9 months ago