Git Product home page Git Product logo

airswap.js's Introduction

AirSwap Logo

Total alerts Language grade: JavaScript NPM version Discord Chat

AirSwap.js

Useful JavaScript modules for Web3 and AirSwap network developers.

Quick Start

yarn add airswap.js

Examples

For more complete examples and a demo web app, see the AirSwap.js-examples repository.

DexIndex Prices

DexIndex is a price aggregator for decentralized trading venues.

import { fetchDexIndexPrices } from 'airswap.js/src/dexIndex'
const prices = await fetchDexIndexPrices({ side, amount, symbol })

Token Metadata

ERC20 token metadata like images and descriptions.

import { fetchTokens } from 'airswap.js/src/tokens'
const tokens = await fetchTokens()

Token Balances

Fetch many balances or allowances for many addresses in a single call.

import { getManyBalancesManyAddresses } from 'airswap.js/src/deltaBalances'

Atomic Swaps

Perform a token swap between parties for both ERC20 and ERC721 (NFT) tokens. The new Swap contract lives on Rinkeby at 0x4E25e972AF14942d119275453CD2DB93B320607c and Kovan at 0x909Af82a14e78d1e8a187D88E6BBA8874f657ef5. Learn more about the Swap Protocol and Swap Contract.

import { swapSimple } from 'airswap.js/src/swap'
const result = swapSimple({ id, makerWallet, makerAmount, makerToken,
  takerWallet, takerAmount, takerToken,
  expiry, v, r, s })

Using Ethers

Ethereum wallet interactions often take a "signer" as a parameter. Learn more about Ethers and signers.

Module Structure

The top-level index.js includes the majority of the application code. It should be isomorphic to be used easily in both NodeJS and browser based applications. The redux folder includes the actions, reducers, and middleware in use by the module.

[submodule-name]
├── index.js
├── redux
│   ├── actions.js
│   ├── index.js
│   ├── middleware.js
└── └── reducers.js

License (Apache-2.0)

Copyright 2019 Swap Holdings Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

airswap.js's People

Contributors

cloudonshore avatar perich avatar syjk129 avatar mykolasmith avatar rhyeal avatar dmosites avatar dependabot[bot] avatar jguyton avatar ejwessel avatar passabilities 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.