📦Javascript SDK

The August Digital SDK provides a JavaScript API for August services and resources. You can use the JavaScript API to build applications or libraries for the browser or Node.js.

Current Version: Alpha v1.0

Whether you're looking to integrate with the August Digital smart contracts or backend API, we've broken up the SDK into multiple subpackages in order to keep the build-size minimal if you don't require the wholistic SDK.

The August Digital SDK package is a compilation of all of the available subpackages. It includes and exports subpackages like the August Digital Pools and August Digital Utilities. Check out all of our available packages and to download only what your application requires.

Getting Started

Installation

Install the package in your project directory with:

npm install @augustdigital/sdk

Initialization

Then, initialize the SDK in your project like this:

import AugustDigitalSDK from '@augustdigital/sdk';

const AugustSDK = new AugustDigitalSDK({
  providers: {
    <CHAIN_ID>: <JSON_RPC_URL>,
    // Mainnet Example:
    // 1: `https://mainnet.infura.io/v3/${INFURA_API_KEY}`,
  }
})

Note: the first provider in the providers object will be what network the SDK is initially connected to.

Usage

There are only a few available methods and properties on the base class AugustDigitalSDK. The many other available methods are exported from the subpackage's respective namespace.

Base Properties and Methods

These are direct properties of the AugustDigitalSDK class and are especially useful when building a multi-chain application. Subpackages are exported directly from the class as well to maintain a consistent RPC connection consistent with the active chain.

Active Network

Check the network the SDK is currently connected to. Without calling switchNetwork, the first property in the providers initialization configuration is active.

AugustSDK.activeNetwork() --> { chainId: number; rpcUrl: string }

Switch Network

Switch the initialized SDK's active network by passing the desired Chain ID. If you pass an already active network, nothing will happen and if you pass a chain that is not configured in the initialization, you will receive an error.

AugustSDK.switchNetwork(chain_id: number) --> void

Providers

See the configured providers that are passed in your initialization configuration.

AugustSDK.providers --> providers initialized configuration

Exported Subpackages

The SDK is broken up in many modules we refer to as "subpackages". These subpackages are used to build the SDK and can be individually installed for a smaller bundle size.

Pools

Methods and properties defined in the lending pools documentation to be used when interacting with our LendingPool contract.

AugustSDK.pools --> AugustDigitalPools class

Other Available Packages

This package contains read and write methods for all August Digital lending pools, as featured on the Kelp DAO restaking app.

This package contains various utility methods to help you quickly bootstrap your blockchain-powered application.

This package contains all common interfaces used throughout the entire SDK.

This package contains all August Digital smart contract ABI's as well as other common ABI's like a standard token ERC20 ABI.

This package exports a custom Winston Logger to quickly debug and log various pieces of your application.

Last updated