Giter Site home page Giter Site logo

descent-collective / descent-sdk Goto Github PK

View Code? Open in Web Editor NEW
3.0 0.0 1.0 1.65 MB

Descent JS is a javaScript library that makes it easy to build applications on top of Descent's smart contracts

License: MIT License

TypeScript 97.85% JavaScript 1.68% HTML 0.48%

descent-sdk's Issues

Improve presets and configuration settings

Overview

The current presets lack flexibility and comprehensive coverage for various environments.
This issue proposes an enhancement to the presets and configuration settings to better accommodate different use cases and improve the overall user experience.

Proposed Changes

The proposed changes involve refining and expanding the existing presets in Descent.create({}) to better cater to different scenarios. Additionally, we will introduce improvements to the configuration settings to enhance customization.

Updated Presets:

browser:

  • Use this preset when employing the library in a browser environment.
  • It will attempt to connect using window.ethereum or window.web3.

https:

  • Connect to a JSON-RPC node.
  • Requires the URL to be set in the options.

test:

  • Use a local node (e.g., Ganache) running at http://127.0.0.1:2000/.
  • Sign transactions using node-managed keys.

Implement deposit collateral method

Overview

The SDK lacks a deposit collateral method utilizing the vaultRouter contract. This issue proposes the implementation of the depositCollateral method

Motivation

Adding a deposit collateral method is essential for users interacting with the Descent protocol vault.

Proposed Changes

Implement a new method in the TypeScript SDK that allows users to deposit collateral using the vaultRouter contract. The method should handle the necessary interactions and transactions seamlessly.

Implementation Details

  • Introduce a new method specifically for adding collaterals to a vault.
  • Utilize token names as part of the collateral parameters
  • Consider gas optimization, error handling, and any potential edge cases during the implementation.

Testing Plan

Unit Tests

  • Create comprehensive unit tests to ensure the correct functioning of the deposit collateral method.

Integration Tests

Conduct integration tests to verify that the method works seamlessly within the SDK and integrates well with other functionalities.

Documentation Updates

Update the Descent documentation to include information on the newly implemented method and it's usage.

Implement getter services using MultiStaticcall

Overview

The SDK lacks efficient mechanisms for retrieving vault information from a peripheral contract. This issue proposes the implementation of getter services using MultiStaticcall to enhance the SDK's capability to fetch vault-related data.

Motivation

Fetching vault information often involves multiple calls to the vaultRouter peripheral contract, resulting in increased latency and decreased efficiency. The integration of MultiStaticcall will allow for a more optimized and streamlined process of retrieving relevant data from the peripheral contract.

Proposed Changes

The proposed changes involve implementing getter services that leverage MultiStaticcall to efficiently retrieve vault information from the peripheral contract.

Implementation Details

  • Introduce a new service or method specifically designed for fetching vault information.
  • Utilize MultiStaticcall to aggregate multiple calls into a single transaction, reducing the number of round trips to the peripheral contract.

Testing Plan

Unit Tests

  • Create comprehensive unit tests to ensure the correct functionality of the newly implemented getter services.

Integration Tests

  • Conduct integration tests to verify that the MultiStaticcall integration works seamlessly with the existing SDK functionality.

Documentation Updates

Update the Descent documentation to include information on the newly implemented getter services and their usage.

Implement mint currency(stablecoin) method

Overview

The SDK lacks a mint currency method utilizing the vaultRouter contract. This issue proposes the implementation of the mintCurrency method

Motivation

Adding a mint currency method is essential for users interacting with the Descent protocol vault.

Proposed Changes

Implement a new method in the TypeScript SDK that allows users to withdraw/mint new stablecoins(currency) using the vaultRouter contract. The method should handle the necessary interactions and transactions seamlessly.

Implementation Details

  • Introduce a new method specifically for minting new currencies.
  • Utilize token names as part of the collateral parameters
  • Consider gas optimization, error handling, and any potential edge cases during the implementation.

Testing Plan

Unit Tests

  • Create comprehensive unit tests to ensure the correct functioning of the mint currency method.

Integration Tests

Conduct integration tests to verify that the method works seamlessly within the SDK and integrates well with other functionalities.

Documentation Updates

Update the Descent documentation to include information on the newly implemented method and it's usage.

Implement payback currency method

Overview

The SDK lacks a payback currency method utilizing the vaultRouter contract. This issue proposes the implementation of the payBack method

Motivation

Adding a payback currency method is essential for users interacting with the Descent protocol vault.

Proposed Changes

Implement a new method in the TypeScript SDK that allows users to pay back the stablecoins borrowed using the vaultRouter contract. The method should handle the necessary interactions and transactions seamlessly.

Implementation Details

  • Introduce a new method specifically for burning currencies/paying back debt.
  • Utilize token names as part of the collateral parameters
  • Consider gas optimization, error handling, and any potential edge cases during the implementation.

Testing Plan

Unit Tests

  • Create comprehensive unit tests to ensure the correct functioning of the mint currency method.

Integration Tests

Conduct integration tests to verify that the method works seamlessly within the SDK and integrates well with other functionalities.

Documentation Updates

Update the Descent documentation to include information on the newly implemented method and it's usage.

Implement withdraw collateral method

Overview

The SDK lacks a withdraw collateral method utilizing the vaultRouter contract. This issue proposes the implementation of the withdrawCollateral method

Motivation

Adding a withdraw collateral method is essential for users interacting with the Descent protocol vault.

Proposed Changes

Implement a new method in the TypeScript SDK that allows users to withdraw available collateral using the vaultRouter contract. The method should handle the necessary interactions and transactions seamlessly.

Implementation Details

  • Introduce a new method specifically for withdrawing collaterals to a vault.
  • Utilize token names as part of the collateral parameters
  • Consider gas optimization, error handling, and any potential edge cases during the implementation.

Testing Plan

Unit Tests

  • Create comprehensive unit tests to ensure the correct functioning of the withdrawing collateral method.

Integration Tests

Conduct integration tests to verify that the method works seamlessly within the SDK and integrates well with other functionalities.

Documentation Updates

Update the Descent documentation to include information on the newly implemented method and it's usage.

Add Support for Base Sepolia Network on SDK

Problem

Currently, the Typescript SDK only supports the Base GOERLI network. We need to enhance the SDK to allow initialization with different networks, enabling it to dynamically interact with contracts on the specified network.

Description

  • Currently, the SDK is limited to the Base Goerli network, restricting its flexibility in working with different blockchain networks.
  • The SDK should be extended to support initialization with a specific network, allowing it to dynamically call contracts on that network.

Acceptance Criteria

  • The SDK should successfully initialize with the specified network(Sepolia).
  • Contract calls should be dynamically routed to the correct network based on the initialization parameter.

Others

  • Find the latest contract deployments for sepolia here => core & periphery

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.