Dai.js Versions Save

v0.15.1

5 years ago

Fixes a bug in the GasService that caused incorrect gas prices to be included with transactions.

v0.15.0

5 years ago
  • Faster proxy contract creation
  • The INFURA provider type now constructs v3 endpoint URLs and requires an infuraProjectId
  • Remove restriction on overriding existing contract addresses with smartContract.addContracts
  • User-provided configuration now overrides plugin-provided configuration

v0.14.0

5 years ago

This release integrates gas prices, fetched from EthGasStation, with all contract calls. It also redesigns the API for gasLimit settings (and changes the service's name from GasEstimatorService to GasService ).

The gasPrice from EthGasStation defaults to the fast value, but that preset can be specified in the configuration.

The following configuration settings are available, all of which are optional:

gas: {
  limit: {
    multiplier: 1.55,
    fallback: 4000000,
    absolute: 4000000
  },
  price: {
    transactionSpeed: 'fastest'
  }
}

gasLimit and gasPrice can each be disabled in one of two ways. First, if a specific value is included with the configuration settings, the service will bypass the other functionality and default to the supplied number:

gas: {
  limit: 4000000,
  price: 12
}

Either option can also simply be disabled. For gasLimit, the fallback will be used. For gasPrice, the value will be omitted from all transactions (except where it's explicitly provided):

gas: {
  limit: {
    disable: true
  }
}

v0.13.2+mcd-0.2.2

5 years ago

v0.13.1

5 years ago

Add the tracksTransactions decorator to DSProxyService.ensureProxy, so that when creating a proxy contract "just-in-time" before running a transaction that requires one, you can track the progress of proxy creation.

Example:

import tracksTransactions from './utils/tracksTransactions';

// pretend this function is inside a service
@tracksTransactions
async function foo(a, b, { promise }) {
  await this.get('proxy').ensureProxy({ promise });
  const d = await callThatNeedsProxy(a, { promise });
  const e = await anotherCall(b, { promise });
  return d + e;
}

const operation = myService.foo();
maker.service('transactionManager').listen(operation, (tx, state) => {
  // this will be called for pending, mined, & confirmed states (assuming 
  // there are no errors) for a tx to create the proxy if it doesn't already 
  // exist, then for the two contract calls, i.e. up to 9 calls
});

const dPlusE = await operation;

v0.13.0

5 years ago

Prior to this release, the gasLimit was defined explicitly as 4000000. This caused max price estimates in MetaMask to display unnecessarily high values. v0.13.0 uses web3's estimateGas function multiplied by a configurable buffer value to set gasLimit dynamically for each transaction. Users can control this with three parameters:

  • absolute: the maximum acceptable gasLimit (defaults to the current block's gas limit)
  • multiplier: the integer used as a buffer on the return value of estimateGas (defaults to 1.55)
  • fallback: the value used as a gasLimit if estimateGas fails (defaults to the gasLimit passed in with transactionSettings in the config object, or 4000000 if none is supplied)

These values can be updated directly. Each setter expects a number greater than zero:

maker.service('gasEstimator').multiplier = 1.75;


This release is also the first one to be built with Babel 7 instead of Babel 6.

v0.12.0

5 years ago

Breaking change: the top-level export Maker no longer has properties Currency, LocalService, etc. These should now be imported from the stand-alone modules @makerdao/currency and @makerdao/services-core.

v0.11.4

5 years ago

Replaces node-fetch with isomorphic-fetch to fix error in frontend builds

v0.11.3

5 years ago

Adds maker.getCdpIds

v0.11.1

5 years ago
  • Moved services-core into external package
  • Bug fixes