August
  • 👋Introduction
  • 🎦Protocol Overview
  • 🪙Token & Tokenomics
  • Using August
    • 🚄TWAP
  • Smart Contracts
    • 🚥Risks and Audits
    • 🔗Contract Addresses
  • Developers
    • 📦Javascript SDK
      • 🤽Lending Pools
      • ⚡Utilities
      • 🔤Types
      • 📜ABI's
    • 🔮Subgraphs
  • Legal
    • 🗒️Legal
      • Terms of Service
      • Privacy Policy
      • Cookie Policy
  • Community
    • Home Page
    • X
Powered by GitBook
On this page
  • Getting Started
  • Installation
  • Initialization
  • Usage
  • Base Properties and Methods
  • Exported Subpackages
  • Other Available Packages
  • Pools
  • Utilities
  • Types
  • ABI's
  1. Developers

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.

PreviousContract AddressesNextLending Pools

Last updated 3 months ago

Current Version: v2.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 entire SDK.

The August Digital SDK package is a compilation of all of the available sub packages including the and . Check out all of 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 using your August API key and various provider RPC URLs:

import AugustDigitalSDK from '@augustdigital/sdk';

const AugustSDK = new AugustDigitalSDK({
  augustKey: <AUGUST_API_KEY>
  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.

Get Token Price

Get a token price by providing a symbol.

AugustSDK.getPrice('SYMBOL') --> { price: number, dt: ISO string }

Active Network

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

Switch Network

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

Providers

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

AugustSDK.pools --> AugustDigitalPools class

Other Available Packages

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.

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

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

See the configured providers that are passed in your .

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

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

📦
lending pools documentation
Pools
Kelp DAO restaking app
Utilities
Types
ABI's
initialization
Chain ID
initialization
initialization configuration
August Digital Pools
August Digital Utilities
our available packages
Logonpm: @augustdigital/sdknpm
Logonpm: @augustdigital/poolsnpm
Logonpm: @augustdigital/utilsnpm
Logonpm: @augustdigital/typesnpm
Logonpm: @augustdigital/abisnpm