Useful JavaScript modules for Web3 and AirSwap network developers.
yarn add airswap.js
For more complete examples and a demo web app, see the AirSwap.js-examples repository.
DexIndex is a price aggregator for decentralized trading venues.
import { fetchDexIndexPrices } from 'airswap.js/src/dexIndex'
const prices = await fetchDexIndexPrices({ side, amount, symbol })
ERC20 token metadata like images and descriptions.
import { fetchTokens } from 'airswap.js/src/tokens'
const tokens = await fetchTokens()
Fetch many balances or allowances for many addresses in a single call.
import { getManyBalancesManyAddresses } from 'airswap.js/src/deltaBalances'
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, makerParam, makerToken,
takerWallet, takerParam, takerToken,
expiry, v, r, s })
Ethereum wallet interactions often take a "signer" as a parameter. Learn more about Ethers and signers.
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
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.