UNPKG

@chorus-one/ethereum

Version:

All-in-one toolkit for building staking dApps on Ethereum network

28 lines (27 loc) 874 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getHarvestParams = void 0; const getHarvestParams = async (connector, vault) => { const harvestData = await connector.graphqlRequest({ type: 'graph', op: 'HarvestParams', query: ` query HarvestParams($address: ID!) { harvestParams: vault(id: $address) { proof rewardsRoot reward: proofReward unlockedMevReward: proofUnlockedMevReward } } `, variables: { address: vault.toLowerCase() } }); if (!harvestData.data.harvestParams) { throw new Error('Vault data is missing the harvestParams field'); } return harvestData.data.harvestParams; }; exports.getHarvestParams = getHarvestParams;