handle-sdk-react
Advanced tools
Comparing version 0.0.23 to 0.0.24
import { ethers, Signer } from "ethers"; | ||
import { FxTokenAddresses } from "../config"; | ||
import { ProtocolAddresses } from "../config"; | ||
@@ -6,2 +7,3 @@ import { RewardPoolData, RewardPoolName, RewardPoolPool, RewardPoolNameMap } from "../types/rewardPool"; | ||
protocolAddresses: ProtocolAddresses; | ||
fxTokenAddresses: FxTokenAddresses; | ||
chainId: number; | ||
@@ -21,2 +23,3 @@ }; | ||
private getContract; | ||
private getKeeperPoolAlias; | ||
} |
@@ -164,9 +164,8 @@ "use strict"; | ||
_a = (0, contract_utils_1.createMulticallProtocolContracts)(this.config.protocolAddresses, this.config.chainId, signer), contracts = _a.contracts, provider = _a.provider; | ||
ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes("governancelock")); | ||
multicall = { | ||
governanceLock: contracts.rewardPool.getPoolIdByAlias(ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes("governanceLock"))), | ||
fxAUDKeeper: contracts.rewardPool.getPoolIdByAlias(ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes("fxAUDKeeper"))), | ||
fxEURKeeper: contracts.rewardPool.getPoolIdByAlias(ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes("fxEURKeeper"))), | ||
fxPHPKeeper: contracts.rewardPool.getPoolIdByAlias(ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes("fxPHPKeeper"))), | ||
fxUSDKeeper: contracts.rewardPool.getPoolIdByAlias(ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes("fxUSDKeeper"))) | ||
governanceLock: contracts.rewardPool.getPoolIdByAlias(ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.toUtf8Bytes("governancelock"))), | ||
fxAUDKeeper: contracts.rewardPool.getPoolIdByAlias(this.getKeeperPoolAlias(this.config.fxTokenAddresses["fxAUD"])), | ||
fxEURKeeper: contracts.rewardPool.getPoolIdByAlias(this.getKeeperPoolAlias(this.config.fxTokenAddresses["fxEUR"])), | ||
fxPHPKeeper: contracts.rewardPool.getPoolIdByAlias(this.getKeeperPoolAlias(this.config.fxTokenAddresses["fxPHP"])), | ||
fxUSDKeeper: contracts.rewardPool.getPoolIdByAlias(this.getKeeperPoolAlias(this.config.fxTokenAddresses["fxUSD"])) | ||
}; | ||
@@ -189,4 +188,8 @@ return [4 /*yield*/, (0, contract_utils_1.callMulticallObject)(multicall, provider)]; | ||
}; | ||
this.getKeeperPoolAlias = function (fxTokenAddress) { | ||
return ethers_1.ethers.utils.keccak256(ethers_1.ethers.utils.solidityPack(["address", "uint256"], [fxTokenAddress, 2])); | ||
}; | ||
this.config = c || { | ||
protocolAddresses: config_1.default.protocol.arbitrum.protocol, | ||
fxTokenAddresses: config_1.default.fxTokenAddresses, | ||
chainId: config_1.default.networkNameToId.arbitrum | ||
@@ -193,0 +196,0 @@ }; |
{ | ||
"name": "handle-sdk-react", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "handle.fi sdk", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
import { ethers, Signer } from "ethers"; | ||
import sdkConfig from "../config"; | ||
import sdkConfig, { FxTokenAddresses } from "../config"; | ||
import { ProtocolAddresses } from "../config"; | ||
@@ -18,2 +18,3 @@ import { RewardPool__factory } from "../contracts"; | ||
protocolAddresses: ProtocolAddresses; | ||
fxTokenAddresses: FxTokenAddresses; | ||
chainId: number; | ||
@@ -49,2 +50,3 @@ }; | ||
protocolAddresses: sdkConfig.protocol.arbitrum.protocol, | ||
fxTokenAddresses: sdkConfig.fxTokenAddresses, | ||
chainId: sdkConfig.networkNameToId.arbitrum | ||
@@ -183,19 +185,17 @@ }; | ||
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("governancelock")); | ||
const multicall: Promisified<RewardPoolIdsMulticall> = { | ||
governanceLock: contracts.rewardPool.getPoolIdByAlias( | ||
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("governanceLock")) | ||
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("governancelock")) | ||
), | ||
fxAUDKeeper: contracts.rewardPool.getPoolIdByAlias( | ||
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("fxAUDKeeper")) | ||
this.getKeeperPoolAlias(this.config.fxTokenAddresses["fxAUD"]) | ||
), | ||
fxEURKeeper: contracts.rewardPool.getPoolIdByAlias( | ||
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("fxEURKeeper")) | ||
this.getKeeperPoolAlias(this.config.fxTokenAddresses["fxEUR"]) | ||
), | ||
fxPHPKeeper: contracts.rewardPool.getPoolIdByAlias( | ||
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("fxPHPKeeper")) | ||
this.getKeeperPoolAlias(this.config.fxTokenAddresses["fxPHP"]) | ||
), | ||
fxUSDKeeper: contracts.rewardPool.getPoolIdByAlias( | ||
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("fxUSDKeeper")) | ||
this.getKeeperPoolAlias(this.config.fxTokenAddresses["fxUSD"]) | ||
) | ||
@@ -220,2 +220,5 @@ }; | ||
}; | ||
private getKeeperPoolAlias = (fxTokenAddress: string) => | ||
ethers.utils.keccak256(ethers.utils.solidityPack(["address", "uint256"], [fxTokenAddress, 2])); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3248797
71526