UNPKG

@graphprotocol/toolshed

Version:

A collection of tools and utilities for the Graph Protocol Typescript components

27 lines 1.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.encodeRegistrationData = encodeRegistrationData; exports.encodeStartServiceData = encodeStartServiceData; exports.encodeCollectIndexingRewardsData = encodeCollectIndexingRewardsData; exports.encodeCollectQueryFeesData = encodeCollectQueryFeesData; exports.encodeStopServiceData = encodeStopServiceData; const ethers_1 = require("ethers"); function encodeRegistrationData(url, geoHash, rewardsDestination) { return ethers_1.ethers.AbiCoder.defaultAbiCoder().encode(['string', 'string', 'address'], [url, geoHash, rewardsDestination]); } function encodeStartServiceData(subgraphDeploymentId, allocationTokens, allocationId, signature) { return ethers_1.ethers.AbiCoder.defaultAbiCoder().encode(['bytes32', 'uint256', 'address', 'bytes'], [subgraphDeploymentId, allocationTokens, allocationId, signature]); } function encodeCollectIndexingRewardsData(allocationId, poi, poiMetadata) { return ethers_1.ethers.AbiCoder.defaultAbiCoder().encode(['address', 'bytes32', 'bytes'], [allocationId, poi, poiMetadata]); } function encodeCollectQueryFeesData(rav, signature, tokensToCollect) { return ethers_1.ethers.AbiCoder.defaultAbiCoder().encode([ 'tuple(tuple(bytes32 collectionId, address payer, address serviceProvider, address dataService, uint64 timestampNs, uint128 valueAggregate, bytes metadata) rav, bytes signature)', 'uint256', ], [{ rav, signature }, tokensToCollect]); } function encodeStopServiceData(allocationId) { return ethers_1.ethers.AbiCoder.defaultAbiCoder().encode(['address'], [allocationId]); } //# sourceMappingURL=subgraph-service.js.map