0.0.13 • Published 8 months ago

node-walrus v0.0.13

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

node-walrus

node-walrus is a JavaScript library for interacting with the Walrus blockchain. It provides a simple and intuitive API for developers to build decentralized applications (dApps).

Example

Demo site: https://node-walrus-example.vercel.app/

https://github.com/Wujerry/node-walrus-example

Features

  • Auto download Walrus bin
  • Api to interact with the Walrus blockchain
  • Typescript support
  • support vercel

Installation

To install Walrus-JS, use npm or yarn or pnpm:

npm install node-walrus
yarn add node-walrus
pnpm add node-walrus

Usage

Create a WalrusClient

const walrus = require('node-walrus')
const path = require('path')

// path to the walrus client config file
const walrusConfigPath = path.join(__dirname, 'client_config.yaml')
const suiWalletConfigPath = path.join(__dirname, 'sui_config.yaml')

const walrusClient = new walrus.WalrusClient(walrusConfigPath, suiWalletConfigPath)

Walrus Info

const walrusInfo = await walrusClient.getInfo()

Store blob

const res = await walrusClient.storeBlob('/path/to/file', { deletable: false })

Read blob

const res = await walrusClient.readBlobToPath('blobId', '/path/to/file')

Blob status

const res = await walrusClient.blobStatus({blobId: 'blobId'})
const res = await walrusClient.blobStatus({file: '/path/to/file'})

Delete blob

const res = await walrusClient.deleteBlob({blobId: 'blobId'})

List blobs

const res = await walrusClient.listBlobs()
0.0.13

8 months ago

0.0.12

8 months ago

0.0.11

8 months ago

0.0.10

8 months ago

0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago