0.0.1 • Published 4 months ago

bapps-sdk v0.0.1

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
4 months ago

⚠️ Development Notice: This SDK is currently under active development and testing. It is not recommended for production use at this time. For updates and documentation, please refer to our official documentation.

Overview

The Based Apps SDK is a TypeScript library for managing Based Applications on the SSV Network.

Core Modules

The SDK consists of three main modules:

  • BasedAppManager: Register BApps, manage tokens, risk levels, created and edit strategies, delegations, deposits
  • API: Access Based Apps data, query states, and retrieve operational information
  • Utils: Helper functions for calculating Participants' Weights and other miscellaneous tasks

Installation

# Using npm
npm i @ssv-labs/ba-sdk

# Using yarn
yarn add @ssv-labs/ba-sdk

# Using pnpm
pnpm install @ssv-labs/ba-sdk

Quick Start

Initialize the SDK

import { BasedAppsSDK } from 'bam-sdk'

const sdk = new BasedAppsSDK({
  chain: 17000,
})

API Examples

// get validator balance of a given account
const response = await sdk.api.bam.getValidatorsBalance({
  account: '0x77fc6e8b24a623725d935bc88057098d0bca6eb3',
})

console.log('response:', response)

Calculate Participants Weights

const strategiesWeights = await sdk.utils.calculateParticipantWeights({
  bAppId: '0x64714cf5db177398729e37627be0fc08f43b17a6',
})

console.log('response:', response)

Documentation

For detailed documentation and examples, visit our official documentation.