JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q43849F
  • License MIT

A simple client for Walrus

Package Exports

  • node-walrus
  • node-walrus/dist/walrusClient.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-walrus) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Walrus-JS

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

Features

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

Installation

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

npm install walrus-js
yarn add walrus-js
pnpm add walrus-js

Usage

Create a WalrusClient

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

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()