GithubHelp home page GithubHelp logo

okjintao / badger-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from badger-finance/badger-sdk

0.0 0.0 0.0 81.25 MB

Badger Protocol Typescript SDK

License: MIT License

Shell 0.03% JavaScript 0.21% TypeScript 99.75%

badger-sdk's Introduction

Badger SDK

BadgerDAO is a decentralized autonomous organization focused on bringing Bitcoin to DeFi. The Badger SDK provides easy access to the Badger Protocol on any chain, as well as fast access to the Badger API for JavaScript applcations.

Version License Service Tests semantic-release: angular

Documentation

Installation

Install the package:

yarn add @badger-dao/sdk

Getting Started

Utilizing the SDK requires an RPC provider:

import BadgerSDK, { Network } from '@badger-dao/sdk';

const sdk = new BadgerSDK({
  network: Network.Ethereum,
  provider: 'https://eth-archival.gateway.pokt.network/v1/lb/<APP_ID>',
});

Or, utilizing the API requires only a network input:

import { BadgerAPI, Network } from '@badger-dao/sdk';

const api = new BadgerAPI({ network: Network.Ethereum });

await api.loadPrices();

Badger subgraph is also available for use:

import { BadgerGraph, Network } from '@badger-dao/sdk';

const subgraph = new BadgerGraph({ network: Network.Ethereum });

await subgraph.loadSetts({
  orderBy: 'id',
  orderDirection: 'asc',
});

Development

Consider to use package lock file, while installing node dependencies:

yarn install --frozen-lockfile

General knowledge for contributing to the repository is kept in Documentation.

Some topics covered include:

Releasing new version

Releases are determined by the commit messages. Commits beginning with fix: will release a new patch version, commits beginning with feat: will release a new minor version, and commits beginning with BREAKING CHANGE: will release a new major version. The action will run on a push to main.

badger-sdk's People

Contributors

0xikalgo avatar btcookies avatar darruma avatar eliobricenov avatar mitche50 avatar namelsking avatar okjintao avatar semantic-release-bot avatar shakotn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.