@sashimiswap/compound-js
Advanced tools
Comparing version 0.4.4-aplha.2 to 0.4.4-aplha.3
@@ -121,3 +121,3 @@ "use strict"; | ||
amount = ethers_1.ethers.BigNumber.from(amount.toString()); | ||
if (util_1.isNativeSlToken(cTokenName, this._network.chainId)) { | ||
if (util_1.isNativeSlToken(cTokenName, this._network.id)) { | ||
options.abi = constants_1.abi.cEther; | ||
@@ -129,3 +129,3 @@ } | ||
options._compoundProvider = this._provider; | ||
if (!(!util_1.isNativeSlToken(cTokenName, this._network.chainId) && noApprove !== true)) return [3 /*break*/, 6]; | ||
if (!(!util_1.isNativeSlToken(cTokenName, this._network.id) && noApprove !== true)) return [3 /*break*/, 6]; | ||
underlyingAddress = constants_1.address[this._network.name][asset]; | ||
@@ -151,3 +151,3 @@ userAddress = this._provider.address; | ||
parameters = []; | ||
if (util_1.isNativeSlToken(cTokenName, this._network.chainId)) { | ||
if (util_1.isNativeSlToken(cTokenName, this._network.id)) { | ||
options.value = amount; | ||
@@ -225,3 +225,3 @@ } | ||
_compoundProvider: this._provider, | ||
abi: util_1.isNativeSlToken(cTokenName, this._network.chainId) ? constants_1.abi.cEther : constants_1.abi.cErc20 | ||
abi: util_1.isNativeSlToken(cTokenName, this._network.id) ? constants_1.abi.cEther : constants_1.abi.cErc20 | ||
}; | ||
@@ -298,3 +298,3 @@ parameters = [amount]; | ||
parameters = [amount]; | ||
trxOptions.abi = util_1.isNativeSlToken(cTokenName, this._network.chainId) ? constants_1.abi.cEther : constants_1.abi.cErc20; | ||
trxOptions.abi = util_1.isNativeSlToken(cTokenName, this._network.id) ? constants_1.abi.cEther : constants_1.abi.cErc20; | ||
return [2 /*return*/, eth.trx(cTokenAddress, 'borrow', parameters, trxOptions)]; | ||
@@ -377,3 +377,3 @@ } | ||
parameters = method === 'repayBorrowBehalf' ? [borrower] : []; | ||
if (util_1.isNativeSlToken(cTokenName, this._network.chainId)) { | ||
if (util_1.isNativeSlToken(cTokenName, this._network.id)) { | ||
trxOptions.value = amount; | ||
@@ -386,3 +386,3 @@ trxOptions.abi = constants_1.abi.cEther; | ||
} | ||
if (!(!util_1.isNativeSlToken(cTokenName, this._network.chainId) && noApprove !== true)) return [3 /*break*/, 6]; | ||
if (!(!util_1.isNativeSlToken(cTokenName, this._network.id) && noApprove !== true)) return [3 /*break*/, 6]; | ||
underlyingAddress = constants_1.address[this._network.name][asset]; | ||
@@ -389,0 +389,0 @@ userAddress = this._provider.address; |
@@ -77,3 +77,3 @@ "use strict"; | ||
_compoundProvider: this._provider, | ||
abi: util_1.isNativeSlToken(cTokenName, this._network.chainId) ? constants_1.abi.cEther : constants_1.abi.cErc20 | ||
abi: util_1.isNativeSlToken(cTokenName, this._network.id) ? constants_1.abi.cEther : constants_1.abi.cErc20 | ||
}; | ||
@@ -80,0 +80,0 @@ return [4 /*yield*/, eth.read(address, method, [], options)]; |
{ | ||
"name": "@sashimiswap/compound-js", | ||
"version": "0.4.4-aplha.2", | ||
"version": "0.4.4-aplha.3", | ||
"author": "Compound Labs, Inc.", | ||
@@ -5,0 +5,0 @@ "description": "A JavaScript SDK for Ethereum and the Compound Protocol.", |
@@ -82,3 +82,3 @@ /** | ||
if (isNativeSlToken(cTokenName, this._network.chainId)) { | ||
if (isNativeSlToken(cTokenName, this._network.id)) { | ||
options.abi = abi.cEther; | ||
@@ -91,3 +91,3 @@ } else { | ||
if (!isNativeSlToken(cTokenName, this._network.chainId) && noApprove !== true) { | ||
if (!isNativeSlToken(cTokenName, this._network.id) && noApprove !== true) { | ||
const underlyingAddress = address[this._network.name][asset]; | ||
@@ -122,3 +122,3 @@ let userAddress = this._provider.address; | ||
const parameters = []; | ||
if (isNativeSlToken(cTokenName, this._network.chainId)) { | ||
if (isNativeSlToken(cTokenName, this._network.id)) { | ||
options.value = amount; | ||
@@ -201,3 +201,3 @@ } else { | ||
_compoundProvider: this._provider, | ||
abi: isNativeSlToken(cTokenName, this._network.chainId) ? abi.cEther : abi.cErc20, | ||
abi: isNativeSlToken(cTokenName, this._network.id) ? abi.cEther : abi.cErc20, | ||
}; | ||
@@ -280,3 +280,3 @@ const parameters = [ amount ]; | ||
const parameters = [ amount ]; | ||
trxOptions.abi = isNativeSlToken(cTokenName, this._network.chainId) ? abi.cEther : abi.cErc20; | ||
trxOptions.abi = isNativeSlToken(cTokenName, this._network.id) ? abi.cEther : abi.cErc20; | ||
@@ -369,3 +369,3 @@ return eth.trx(cTokenAddress, 'borrow', parameters, trxOptions); | ||
const parameters: any[] = method === 'repayBorrowBehalf' ? [ borrower ] : []; | ||
if (isNativeSlToken(cTokenName, this._network.chainId)) { | ||
if (isNativeSlToken(cTokenName, this._network.id)) { | ||
trxOptions.value = amount; | ||
@@ -378,3 +378,3 @@ trxOptions.abi = abi.cEther; | ||
if (!isNativeSlToken(cTokenName, this._network.chainId) && noApprove !== true) { | ||
if (!isNativeSlToken(cTokenName, this._network.id) && noApprove !== true) { | ||
const underlyingAddress = address[this._network.name][asset]; | ||
@@ -381,0 +381,0 @@ let userAddress = this._provider.address; |
@@ -56,3 +56,3 @@ /** | ||
_compoundProvider: this._provider, | ||
abi: isNativeSlToken(cTokenName, this._network.chainId) ? abi.cEther : abi.cErc20, | ||
abi: isNativeSlToken(cTokenName, this._network.id) ? abi.cEther : abi.cErc20, | ||
}; | ||
@@ -59,0 +59,0 @@ const exchangeRateCurrent = await eth.read(address, method, [], options); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1551165