Giter VIP home page Giter VIP logo

dequanto's Introduction

dequanto

Documentation Link CircleCI

Here we share our library to work with Ethereum Virtual Machine RPC Nodes: Ethereum, Polygon, BSC, Arbitrum, etc. We use web3 and ethers to provide new Features and to simplify the API.

  1. RPC Client Pool
  2. Transaction Builder
  3. Generated TypeScript classes for contracts
  4. Etherscan & Co clients
  5. Tokens provider - get token data by symbol, address, platform.
  6. Tokens service - transfer and swap
  7. Transaction Indexers - listens to blocks and parse new transactions to simplify further processing
  8. Native BigInt types and various utility methods
  9. OpenZeppelin contracts

Source-Code Distribution

Not as a library, but as the source code. Clone or fork it and use it as a submodule. Means: a) you can import any class, namespace and utility method. b) you can easily extend and modify any class, namespace and utility method. c) you get the documentation direct from the code. We don't have much time yet to document all the parts

And path prefix (alias) to your tsconfig.json

{
    "compilerOptions": {
        "paths": {
            "@dequanto/*": [ "your-sub-module-folder/src/*" ],
            "@dequanto-contract/*": [ "your-sub-module-folder/contract/*" ]
        }
    }
}

Configuration

Before you use the code, you should prepare the configuration for it: Node RPC URLs, Accounts, Blockchain Explorer API Keys, etc.

1. RPC Client Pool

Provide multiple RPC Node URLs, this will make your application much more reliable. Even if one of the Nodes goes down or for some reason is not in-sync, all your RPC calls will still work.

Web3Client is the base class for all the EVM Platforms. This wraps web3 to provide pool-based communication with nodes. It handles also Gas and Nonce Values.

2. Transaction Builder

TxDataBuilder and TxWriter to create and submit transaction.

3. Generated TypeScript classes for contracts

With auto-generated classes you can

a) type-safe method read and write(transaction) calls to blockchain b) parse receipts of the contract transactions c) easily subscribe to event streams of the contract

4. Etherscan&Co clients

Ready to use Etherscan&Co classes to consume their API. Just drop-in the KEYs.

5. Tokens provider

Get Tokens Data (address, decimals, etc) by symbol and platform

6. Tokens service

One-liners to transfer tokens from A to B, or swap the tokens using popular DEXes

7. Transaction Indexers

Start listening the blockchain with less code

8. Utils

Lots of Utility methods. BigInt are the first-class citizens in the code.

9. OpenZeppelin contracts

We prebuild generic OpenZeppelin contracts

import { ERC20 } from '@dequanto-contracts/openzeppelin/ERC20

let erc20 = new ERC20(`0x...`);
let balance = await erc20.balanceOf('0x...');

dequanto's People

Contributors

tenbits avatar dependabot[bot] 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.