@fairmint/safe-js
Advanced tools
Comparing version
{ | ||
"name": "@fairmint/safe-js", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Safe javascript library.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -213,6 +213,6 @@ const Ethers = require("ethers"); | ||
userId, | ||
jurisdictionId, | ||
totalTokensLocked, | ||
startIndex, | ||
endIndex, | ||
jurisdictionId : newBigNumber(jurisdictionId).toString(), | ||
totalTokensLocked : newBigNumber(totalTokensLocked).toString(), | ||
startIndex : newBigNumber(startIndex).toString(), | ||
endIndex : newBigNumber(endIndex).toString(), | ||
}; | ||
@@ -296,10 +296,2 @@ } | ||
manualBuy(sendToAddress, currencyAmount) { | ||
const buyAmount = newBigNumber(currencyAmount) | ||
.shiftedBy(this.data.currency.decimals) | ||
.dp(0); | ||
return this.dat | ||
.manualBuy(sendToAddress, buyAmount.toFixed()); | ||
} | ||
/** | ||
@@ -312,3 +304,3 @@ * | ||
*/ | ||
async signPermit(spender, value, deadline, nonce) { | ||
async signPermit(spender, value, deadline) { | ||
// Original source: https://medium.com/metamask/eip712-is-coming-what-to-expect-and-how-to-use-it-bb92fd1a7a26 | ||
@@ -328,7 +320,3 @@ const domain = [ | ||
]; | ||
let { chainId } = await this.provider.getNetwork(); | ||
if (chainId >= 1337) { | ||
// Ganache uses chainId 1 | ||
chainId = 1; | ||
} | ||
const { chainId } = await this.provider.getNetwork(); | ||
const domainData = { | ||
@@ -344,5 +332,5 @@ name : this.data.name, | ||
value : value === undefined ? constants.MAX_UINT : value, | ||
nonce : nonce === undefined | ||
? await this.dat.nonces(this.data.account.address) | ||
: nonce, | ||
nonce : newBigNumber( | ||
await this.dat.nonces(this.data.account.address) | ||
).toString(), | ||
deadline: deadline || constants.MAX_UINT, | ||
@@ -359,3 +347,4 @@ }; | ||
}; | ||
return this.provider.send("eth_signTypedData_v4", [ | ||
const signer = this.provider.getSigner(); | ||
return signer.provider.send("eth_signTypedData_v4", [ | ||
this.data.account.address, | ||
@@ -404,7 +393,3 @@ JSON.stringify(data), | ||
]; | ||
let { chainId } = await this.provider.getNetwork(); | ||
if (chainId >= 1337) { | ||
// Ganache uses chainId 1 | ||
chainId = 1; | ||
} | ||
const { chainId } = await this.provider.getNetwork(); | ||
const result = await this.provider.send("eth_call", [ | ||
@@ -421,3 +406,3 @@ { | ||
const domainData = { | ||
name : await this.currency.name(), | ||
name : this.data.currency.name, | ||
version, | ||
@@ -432,4 +417,5 @@ chainId, | ||
deadline, | ||
nonce : await this.currency | ||
.nonces(this.data.account.address), | ||
nonce : newBigNumber( | ||
await this.currency.nonces(this.data.account.address) | ||
).toString(), | ||
}; | ||
@@ -445,3 +431,5 @@ const data = { | ||
}; | ||
return this.provider.send("eth_signTypedData_v4", [ | ||
const signer = this.provider.getSigner(); | ||
return signer.provider.send("eth_signTypedData_v4", [ | ||
this.data.account.address, | ||
@@ -481,4 +469,3 @@ JSON.stringify(data), | ||
minTokensBought, | ||
deadline, | ||
nonce | ||
deadline | ||
) { | ||
@@ -517,7 +504,3 @@ let sendTo; | ||
]; | ||
let { chainId } = await this.provider.getNetwork(); | ||
if (chainId >= 1337) { | ||
// Ganache uses chainId 1 | ||
chainId = 1; | ||
} | ||
const { chainId } = await this.provider.getNetwork(); | ||
const domainData = { | ||
@@ -534,5 +517,5 @@ name : this.data.name, | ||
minTokensBought : minBuyValue.toFixed(), | ||
nonce : nonce === undefined | ||
? await this.dat.nonces(this.data.account.address) | ||
: nonce, | ||
nonce : newBigNumber( | ||
await this.dat.nonces(this.data.account.address) | ||
).toString(), | ||
deadline: deadline || constants.MAX_UINT, | ||
@@ -549,3 +532,4 @@ }; | ||
}; | ||
return this.provider.send("eth_signTypedData_v4", [ | ||
const signer = this.provider.getSigner(); | ||
return signer.provider.send("eth_signTypedData_v4", [ | ||
this.data.account.address, | ||
@@ -609,4 +593,3 @@ JSON.stringify(data), | ||
minCurrencyReturned, | ||
deadline, | ||
nonce | ||
deadline | ||
) { | ||
@@ -645,7 +628,3 @@ let sendTo; | ||
]; | ||
let { chainId } = await this.provider.getNetwork(); | ||
if (chainId >= 1337) { | ||
// Ganache uses chainId 1 | ||
chainId = 1; | ||
} | ||
const { chainId } = await this.provider.getNetwork(); | ||
const domainData = { | ||
@@ -662,5 +641,5 @@ name : this.data.name, | ||
minCurrencyReturned : minCurrencyValue.toFixed(), | ||
nonce : nonce === undefined | ||
? await this.dat.nonces(this.data.account.address) | ||
: nonce, | ||
nonce : newBigNumber( | ||
await this.dat.nonces(this.data.account.address) | ||
).toString(), | ||
deadline: deadline || constants.MAX_UINT, | ||
@@ -677,3 +656,4 @@ }; | ||
}; | ||
return this.provider.send("eth_signTypedData_v4", [ | ||
const signer = this.provider.getSigner(); | ||
return signer.provider.send("eth_signTypedData_v4", [ | ||
this.data.account.address, | ||
@@ -680,0 +660,0 @@ JSON.stringify(data), |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%127380
-0.17%5225
-0.38%