polkastarter-js
polkastarter-js is package to integrate Polkastarter Ethereum Integrations
Installation
Use the package manager [npm] to install npm.
npm i polkastarter-js
Docs
Docs
Usage
import moment from 'moment';
import Application from 'polkastarter-js/src/models';
let app = new Application({test : true});
let swapContract = app.getFixedSwapContract({tokenAddress : '0x3237fff7f25a354f68b2054a019c5a00135a8955', decimals : 18});
await swapContract.deploy({
tradeValue : 0.001,
tokensForSale : 100,
startDate : moment().add(6, 'hours'),
endDate : moment().add(16, 'hours'),
isETHTrade : true
ERC20TradingAddress :
isPOLSWhitelist : false
});
await swapContract.swap({
tokenAmount : 10
});
await swapContract.isApprovedSwapERC20({
tokenAmount : 10 ,
address :
});
await swapContract.approveSwapERC20({
tokenAmount : 10
});
await swapContract.swap({
tokenAmount : 10
});
Testing
To run the test suite vs a local chain (ganache):
npm test
To run the test suite vs a testnet real chain (Kovan, BSC Testnet, etc):
CHAIN_NAME=ETH npm test
Testing old deployed pools
This test will check that the current PSJS doesn't break the read method from already deployed pools, legacy or not.
npm run test-pools
License
MIT