diff --git a/packages/sdk-core/CHANGELOG.md b/packages/sdk-core/CHANGELOG.md index 0191f309fe..cd4043c816 100644 --- a/packages/sdk-core/CHANGELOG.md +++ b/packages/sdk-core/CHANGELOG.md @@ -6,9 +6,17 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +### Added + +- Added `getTotalAmountReceivedByMember` + ### Changed + - Map the name from subgraph to an unknown event, instead of "\_Unknown". - Don't lock metadata version to a specific version, use semver (^). +- Allow infinite pagination with 'skip: 0' value (previously had to be undefined) +- Add subgraphs queries for Pools, PoolMembers and PoolDistributors +- Map `isNFTApproval` and `isNFTTransfer` onto events ## [0.6.12] - 2023-10-23 diff --git a/packages/sdk-core/src/SuperfluidPool.ts b/packages/sdk-core/src/SuperfluidPool.ts index 62312f1cfe..dbe642aac9 100644 --- a/packages/sdk-core/src/SuperfluidPool.ts +++ b/packages/sdk-core/src/SuperfluidPool.ts @@ -13,6 +13,7 @@ import { GetClaimableParams, GetDisconnectedBalanceParams, GetMemberFlowRateParams, + GetTotalAmountReceivedByMemberParams, GetUnitsParams, SuperfluidPoolDecreaseAllowanceParams, SuperfluidPoolIncreaseAllowanceParams, @@ -236,6 +237,31 @@ export default class SuperfluidPoolClass { } }; + /** + * Retrieves the flow rate for a specific member. + * @param member The member's address. + * @param providerOrSigner A provider or signer object + * @returns The total amount received by the member. + */ + getTotalAmountReceivedByMember = async ( + params: GetTotalAmountReceivedByMemberParams + ): Promise => { + try { + return ( + await this.contract + .connect(params.providerOrSigner) + .getTotalAmountReceivedByMember(params.member) + ).toString(); + } catch (err) { + throw new SFError({ + type: "SUPERFLUID_POOL_READ", + message: + "There was an error getting the total amount received by member.", + cause: err, + }); + } + }; + /** * Retrieves the claimable amount for a specific member and time. * @param member The member's address. diff --git a/packages/sdk-core/src/events.ts b/packages/sdk-core/src/events.ts index 5328dd6a6f..ad2cd8aa0d 100644 --- a/packages/sdk-core/src/events.ts +++ b/packages/sdk-core/src/events.ts @@ -183,6 +183,7 @@ export interface TransferEvent extends EventBase { to: string; value: string; token: string; + isNFTTransfer: boolean; } export interface AgreementClassRegisteredEvent extends EventBase { @@ -468,6 +469,7 @@ export interface MemberUnitsUpdatedEvent extends EventBase { } export interface ApprovalEvent extends EventBase { name: "ApprovalEvent"; + isNFTApproval: boolean; } export interface ApprovalForAllEvent extends EventBase { name: "ApprovalForAllEvent"; diff --git a/packages/sdk-core/src/index.ts b/packages/sdk-core/src/index.ts index 6834a8bc16..4e12a39c19 100644 --- a/packages/sdk-core/src/index.ts +++ b/packages/sdk-core/src/index.ts @@ -52,7 +52,10 @@ export * from "./subgraph/entities/streamPeriod/streamPeriod"; export * from "./subgraph/entities/token/token"; export * from "./subgraph/entities/tokenStatistic/tokenStatistic"; export * from "./subgraph/entities/tokenStatisticLog/tokenStatisticLog"; -export * from "./subgraph/entities/flowOperator/flowOperators"; +export * from "./subgraph/entities/flowOperator/flowOperator"; +export * from "./subgraph/entities/pool/pool"; +export * from "./subgraph/entities/poolMember/poolMember"; +export * from "./subgraph/entities/poolDistributor/poolDistributor"; export * from "./subgraph/events/events"; export * from "./subgraph/events/flowUpdatedEvent"; diff --git a/packages/sdk-core/src/interfaces.ts b/packages/sdk-core/src/interfaces.ts index 5207ecc4f2..9093b9ed39 100644 --- a/packages/sdk-core/src/interfaces.ts +++ b/packages/sdk-core/src/interfaces.ts @@ -778,6 +778,11 @@ export interface GetMemberFlowRateParams { readonly providerOrSigner: ethers.providers.Provider | ethers.Signer; } +export interface GetTotalAmountReceivedByMemberParams { + readonly member: string; + readonly providerOrSigner: ethers.providers.Provider | ethers.Signer; +} + export interface ClaimAllForMemberParams { readonly member: string; readonly signer: ethers.Signer; diff --git a/packages/sdk-core/src/mapGetAllEventsQueryEvents.ts b/packages/sdk-core/src/mapGetAllEventsQueryEvents.ts index 131595cdbe..9d144e19af 100644 --- a/packages/sdk-core/src/mapGetAllEventsQueryEvents.ts +++ b/packages/sdk-core/src/mapGetAllEventsQueryEvents.ts @@ -598,6 +598,7 @@ export const mapGetAllEventsQueryEvents = ( to: x.to.id, token: x.token, value: x.value, + isNFTTransfer: x.isNFTTransfer, }); case "TrustedForwarderChangedEvent": return typeGuard({ @@ -760,6 +761,7 @@ export const mapGetAllEventsQueryEvents = ( order: Number(x.order), timestamp: Number(x.timestamp), logIndex: Number(x.logIndex), + isNFTApproval: x.isNFTApproval, }); case "ApprovalForAllEvent": return typeGuard({ @@ -786,9 +788,6 @@ export const mapGetAllEventsQueryEvents = ( default: // eslint-disable-next-line no-case-declarations const eventBase = x as events.EventBase; - console.warn( - `An unknown event [${eventBase.name}] was detected which couldn't be properly mapped. Please update to the latest version of @superfluid-finance/sdk-core.` - ); return typeGuard({ // force casted as empty string for the type system name: eventBase.name as "", diff --git a/packages/sdk-core/src/pagination.ts b/packages/sdk-core/src/pagination.ts index 1e6bef1ed8..a4b8c1df21 100644 --- a/packages/sdk-core/src/pagination.ts +++ b/packages/sdk-core/src/pagination.ts @@ -121,7 +121,7 @@ export function isLastIdPaging(paging?: Paging): paging is LastIdPaging { export function isAllPaging(paging?: Paging): paging is AllPaging { return ( paging !== undefined && - paging.skip === undefined && + !paging.skip && paging.lastId === undefined && paging.take === Infinity ); diff --git a/packages/sdk-core/src/subgraph/entities/flowOperator/flowOperators.ts b/packages/sdk-core/src/subgraph/entities/flowOperator/flowOperator.ts similarity index 100% rename from packages/sdk-core/src/subgraph/entities/flowOperator/flowOperators.ts rename to packages/sdk-core/src/subgraph/entities/flowOperator/flowOperator.ts diff --git a/packages/sdk-core/src/subgraph/entities/pool/pool.ts b/packages/sdk-core/src/subgraph/entities/pool/pool.ts new file mode 100644 index 0000000000..7516d14c07 --- /dev/null +++ b/packages/sdk-core/src/subgraph/entities/pool/pool.ts @@ -0,0 +1,122 @@ +import { + Address, + BigNumber, + BlockNumber, + Timestamp, +} from "../../mappedSubgraphTypes"; +import { Pool_Filter, Pool_OrderBy } from "../../schema.generated"; +import { + RelevantAddressesIntermediate, + SubgraphListQuery, + SubgraphQueryHandler, +} from "../../subgraphQueryHandler"; + +import { + GetPoolQuery, + PoolsDocument, + PoolsQuery, + PoolsQueryVariables, +} from "./pools.generated"; + +export type PoolListQuery = SubgraphListQuery; + +export interface Pool { + id: Address; + createdAtTimestamp: Timestamp; + createdAtBlockNumber: BlockNumber; + updatedAtTimestamp: Timestamp; + updatedAtBlockNumber: BlockNumber; + totalAmountInstantlyDistributedUntilUpdatedAt: BigNumber; + totalAmountFlowedDistributedUntilUpdatedAt: BigNumber; + totalAmountDistributedUntilUpdatedAt: BigNumber; + totalFlowAdjustmentAmountDistributedUntilUpdatedAt: BigNumber; + totalUnits: BigNumber; + totalConnectedUnits: BigNumber; + totalDisconnectedUnits: BigNumber; + perUnitSettledValue: BigNumber; + perUnitFlowRate: BigNumber; + /** + * A member is any account which has more than 0 units in the pool. + */ + totalMembers: number; + /** + * A connected member is any account which has more than 0 units in the pool and is connected. + */ + totalConnectedMembers: number; + /** + * A disconnected member is any account which has more than 0 units in the pool and is not connected. + */ + totalDisconnectedMembers: number; + adjustmentFlowRate: BigNumber; + flowRate: BigNumber; + totalBuffer: BigNumber; + token: Address; + admin: Address; +} + +export type SubgraphPool = NonNullable["pool"]>; + +export const mapSubgraphGDAPool = (x: SubgraphPool): Pool => { + const mappedPool = { + ...x, + createdAtTimestamp: Number(x.createdAtTimestamp), + createdAtBlockNumber: Number(x.createdAtBlockNumber), + updatedAtTimestamp: Number(x.updatedAtTimestamp), + updatedAtBlockNumber: Number(x.updatedAtBlockNumber), + totalAmountInstantlyDistributedUntilUpdatedAt: + x.totalAmountInstantlyDistributedUntilUpdatedAt, + totalAmountFlowedDistributedUntilUpdatedAt: + x.totalAmountFlowedDistributedUntilUpdatedAt, + totalAmountDistributedUntilUpdatedAt: + x.totalAmountDistributedUntilUpdatedAt, + admin: x.admin.id, + token: x.token.id, + }; + + return mappedPool; +}; + +export class PoolQueryHandler extends SubgraphQueryHandler< + Pool, + PoolListQuery, + PoolsQuery, + PoolsQueryVariables +> { + getAddressFieldKeysFromFilter = (): { + accountKeys: (keyof Pool_Filter)[]; + tokenKeys: (keyof Pool_Filter)[]; + } => ({ + accountKeys: ["admin", "id"], + tokenKeys: ["token"], + }); + + getRelevantAddressesFromResultCore = ( + result: Pool + ): RelevantAddressesIntermediate => ({ + tokens: [result.token], + accounts: [result.admin, result.id], + }); + + mapFromSubgraphResponse = (response: PoolsQuery): Pool[] => + response.pools.map((x) => ({ + ...x, + createdAtTimestamp: Number(x.createdAtTimestamp), + createdAtBlockNumber: Number(x.createdAtBlockNumber), + updatedAtTimestamp: Number(x.updatedAtTimestamp), + updatedAtBlockNumber: Number(x.updatedAtBlockNumber), + totalAmountInstantlyDistributedUntilUpdatedAt: + x.totalAmountInstantlyDistributedUntilUpdatedAt, + totalAmountFlowedDistributedUntilUpdatedAt: + x.totalAmountFlowedDistributedUntilUpdatedAt, + totalAmountDistributedUntilUpdatedAt: + x.totalAmountDistributedUntilUpdatedAt, + totalFlowAdjustmentAmountDistributedUntilUpdatedAt: + x.totalFlowAdjustmentAmountDistributedUntilUpdatedAt, + perUnitFlowRate: x.perUnitFlowRate, + perUnitSettledValue: x.perUnitSettledValue, + admin: x.admin.id, + token: x.token.id, + })); + + requestDocument = PoolsDocument; +} diff --git a/packages/sdk-core/src/subgraph/entities/pool/pools.graphql b/packages/sdk-core/src/subgraph/entities/pool/pools.graphql new file mode 100644 index 0000000000..1492b3e102 --- /dev/null +++ b/packages/sdk-core/src/subgraph/entities/pool/pools.graphql @@ -0,0 +1,54 @@ +query getPool($id: ID!) { + pool(id: $id) { + ...PoolPart + } +} + +query pools( + $first: Int = 10 + $orderBy: Pool_orderBy = id + $orderDirection: OrderDirection = asc + $skip: Int = 0 + $where: Pool_filter = {} + $block: Block_height +) { + pools( + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + skip: $skip + where: $where + block: $block + ) { + ...PoolPart + } +} + +fragment PoolPart on Pool { + id + createdAtTimestamp + createdAtBlockNumber + updatedAtTimestamp + updatedAtBlockNumber + admin { + id + } + token { + id + } + totalMembers + totalUnits + totalConnectedMembers + totalConnectedUnits + totalDisconnectedMembers + totalDisconnectedUnits + totalAmountInstantlyDistributedUntilUpdatedAt + flowRate + perUnitSettledValue + perUnitFlowRate + totalBuffer + totalAmountFlowedDistributedUntilUpdatedAt + totalAmountDistributedUntilUpdatedAt + adjustmentFlowRate + totalFlowAdjustmentAmountDistributedUntilUpdatedAt +} diff --git a/packages/sdk-core/src/subgraph/entities/poolDistributor/poolDistributor.ts b/packages/sdk-core/src/subgraph/entities/poolDistributor/poolDistributor.ts new file mode 100644 index 0000000000..2f8894ccd2 --- /dev/null +++ b/packages/sdk-core/src/subgraph/entities/poolDistributor/poolDistributor.ts @@ -0,0 +1,81 @@ +import { + Address, + BigNumber, + BlockNumber, + SubgraphId, + Timestamp, +} from "../../mappedSubgraphTypes"; +import { + PoolDistributor_Filter, + PoolDistributor_OrderBy, +} from "../../schema.generated"; +import { + RelevantAddressesIntermediate, + SubgraphListQuery, + SubgraphQueryHandler, +} from "../../subgraphQueryHandler"; + +import { + PoolDistributorsDocument, + PoolDistributorsQuery, + PoolDistributorsQueryVariables, +} from "./poolDistributors.generated"; + +export interface PoolDistributor { + id: SubgraphId; + createdAtTimestamp: Timestamp; + createdAtBlockNumber: BlockNumber; + updatedAtTimestamp: Timestamp; + updatedAtBlockNumber: BlockNumber; + totalBuffer: BigNumber; + totalAmountInstantlyDistributedUntilUpdatedAt: BigNumber; + totalAmountFlowedDistributedUntilUpdatedAt: BigNumber; + totalAmountDistributedUntilUpdatedAt: BigNumber; + flowRate: BigNumber; + account: Address; + pool: Address; + token: Address; +} + +export type PoolDistributorsListQuery = SubgraphListQuery< + PoolDistributor_Filter, + PoolDistributor_OrderBy +>; + +export class PoolDistributorQueryHandler extends SubgraphQueryHandler< + PoolDistributor, + PoolDistributorsListQuery, + PoolDistributorsQuery, + PoolDistributorsQueryVariables +> { + getAddressFieldKeysFromFilter = (): { + accountKeys: (keyof PoolDistributor_Filter)[]; + tokenKeys: (keyof PoolDistributor_Filter)[]; + } => ({ + accountKeys: ["account", "pool"], + tokenKeys: [], + }); + + getRelevantAddressesFromResultCore = ( + result: PoolDistributor + ): RelevantAddressesIntermediate => ({ + tokens: [result.token], + accounts: [result.account, result.pool], + }); + + mapFromSubgraphResponse = ( + response: PoolDistributorsQuery + ): PoolDistributor[] => + response.poolDistributors.map((x) => ({ + ...x, + createdAtTimestamp: Number(x.createdAtTimestamp), + createdAtBlockNumber: Number(x.createdAtBlockNumber), + updatedAtTimestamp: Number(x.updatedAtTimestamp), + updatedAtBlockNumber: Number(x.updatedAtBlockNumber), + pool: x.pool.id, + token: x.pool.token.id, + account: x.account.id, + })); + + requestDocument = PoolDistributorsDocument; +} diff --git a/packages/sdk-core/src/subgraph/entities/poolDistributor/poolDistributors.graphql b/packages/sdk-core/src/subgraph/entities/poolDistributor/poolDistributors.graphql new file mode 100644 index 0000000000..beed5a215b --- /dev/null +++ b/packages/sdk-core/src/subgraph/entities/poolDistributor/poolDistributors.graphql @@ -0,0 +1,37 @@ +query poolDistributors( + $first: Int = 10 + $skip: Int = 0 + $orderBy: PoolDistributor_orderBy = id + $orderDirection: OrderDirection = asc + $where: PoolDistributor_filter = {} + $block: Block_height +) { + poolDistributors( + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + skip: $skip + where: $where + block: $block + ) { + createdAtTimestamp + createdAtBlockNumber + updatedAtTimestamp + updatedAtBlockNumber + totalBuffer + totalAmountInstantlyDistributedUntilUpdatedAt + totalAmountFlowedDistributedUntilUpdatedAt + totalAmountDistributedUntilUpdatedAt + id + flowRate + account { + id + } + pool { + id + token { + id + } + } + } +} diff --git a/packages/sdk-core/src/subgraph/entities/poolMember/poolMember.ts b/packages/sdk-core/src/subgraph/entities/poolMember/poolMember.ts new file mode 100644 index 0000000000..553235723a --- /dev/null +++ b/packages/sdk-core/src/subgraph/entities/poolMember/poolMember.ts @@ -0,0 +1,80 @@ +import { + Address, + BigNumber, + BlockNumber, + SubgraphId, + Timestamp, +} from "../../mappedSubgraphTypes"; +import { PoolMember_Filter, PoolMember_OrderBy } from "../../schema.generated"; +import { + RelevantAddressesIntermediate, + SubgraphListQuery, + SubgraphQueryHandler, +} from "../../subgraphQueryHandler"; + +import { + PoolMembersDocument, + PoolMembersQuery, + PoolMembersQueryVariables, +} from "./poolMembers.generated"; + +export interface PoolMember { + id: SubgraphId; + createdAtBlockNumber: BlockNumber; + createdAtTimestamp: Timestamp; + updatedAtTimestamp: Timestamp; + updatedAtBlockNumber: BlockNumber; + units: BigNumber; + account: Address; + isConnected: boolean; + totalAmountClaimed: BigNumber; + token: Address; + totalAmountReceivedUntilUpdatedAt: BigNumber; + poolTotalAmountDistributedUntilUpdatedAt: BigNumber; + pool: Address; + syncedPerUnitFlowRate: BigNumber; + syncedPerUnitSettledValue: BigNumber; +} + +export type PoolMembersListQuery = SubgraphListQuery< + PoolMember_Filter, + PoolMember_OrderBy +>; + +export class PoolMemberQueryHandler extends SubgraphQueryHandler< + PoolMember, + PoolMembersListQuery, + PoolMembersQuery, + PoolMembersQueryVariables +> { + getAddressFieldKeysFromFilter = (): { + accountKeys: (keyof PoolMember_Filter)[]; + tokenKeys: (keyof PoolMember_Filter)[]; + } => ({ + accountKeys: ["account", "pool"], + tokenKeys: [], + }); + + getRelevantAddressesFromResultCore = ( + result: PoolMember + ): RelevantAddressesIntermediate => ({ + tokens: [result.token], + accounts: [result.account, result.pool], + }); + + mapFromSubgraphResponse = (response: PoolMembersQuery): PoolMember[] => + response.poolMembers.map((x) => ({ + ...x, + account: x.account.id, + createdAtTimestamp: Number(x.createdAtTimestamp), + createdAtBlockNumber: Number(x.createdAtBlockNumber), + updatedAtTimestamp: Number(x.updatedAtTimestamp), + updatedAtBlockNumber: Number(x.updatedAtBlockNumber), + pool: x.pool.id, + token: x.pool.token.id, + syncedPerUnitFlowRate: x.syncedPerUnitFlowRate, + syncedPerUnitSettledValue: x.syncedPerUnitSettledValue, + })); + + requestDocument = PoolMembersDocument; +} diff --git a/packages/sdk-core/src/subgraph/entities/poolMember/poolMembers.graphql b/packages/sdk-core/src/subgraph/entities/poolMember/poolMembers.graphql new file mode 100644 index 0000000000..90e9cd5bec --- /dev/null +++ b/packages/sdk-core/src/subgraph/entities/poolMember/poolMembers.graphql @@ -0,0 +1,39 @@ +query poolMembers( + $first: Int = 10 + $skip: Int = 0 + $orderBy: PoolMember_orderBy = id + $orderDirection: OrderDirection = asc + $where: PoolMember_filter = {} + $block: Block_height +) { + poolMembers( + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + skip: $skip + where: $where + block: $block + ) { + id + createdAtTimestamp + createdAtBlockNumber + updatedAtTimestamp + updatedAtBlockNumber + units + pool { + id + token { + id + } + } + account { + id + } + isConnected + totalAmountClaimed + totalAmountReceivedUntilUpdatedAt + poolTotalAmountDistributedUntilUpdatedAt + syncedPerUnitFlowRate + syncedPerUnitSettledValue + } +} diff --git a/packages/sdk-core/src/subgraph/events/events.graphql b/packages/sdk-core/src/subgraph/events/events.graphql index 59ee519b39..e72b88c012 100644 --- a/packages/sdk-core/src/subgraph/events/events.graphql +++ b/packages/sdk-core/src/subgraph/events/events.graphql @@ -14,6 +14,7 @@ query flowUpdatedEvents( where: $where block: $block ) { + name ...flowUpdatedEvent } } @@ -34,6 +35,7 @@ query flowOperatorUpdatedEvents( where: $where block: $block ) { + name ...flowOperatorUpdatedEvent } } @@ -54,6 +56,7 @@ query indexCreatedEvents( where: $where block: $block ) { + name ...indexCreatedEvent } } @@ -74,6 +77,7 @@ query indexDistributionClaimedEvents( where: $where block: $block ) { + name ...indexDistributionClaimedEvent } } @@ -94,6 +98,7 @@ query indexUpdatedEvents( where: $where block: $block ) { + name ...indexUpdatedEvent } } @@ -114,6 +119,7 @@ query indexSubscribedEvents( where: $where block: $block ) { + name ...indexSubscribedEvent } } @@ -134,6 +140,7 @@ query indexUnitsUpdatedEvents( where: $where block: $block ) { + name ...indexUnitsUpdatedEvent } } @@ -154,6 +161,7 @@ query indexUnsubscribedEvents( where: $where block: $block ) { + name ...indexUnsubscribedEvent } } @@ -174,6 +182,7 @@ query subscriptionApprovedEvents( where: $where block: $block ) { + name ...subscriptionApprovedEvent } } @@ -194,6 +203,7 @@ query subscriptionDistributionClaimedEvents( where: $where block: $block ) { + name ...subscriptionDistributionClaimedEvent } } @@ -214,6 +224,7 @@ query subscriptionRevokedEvents( where: $where block: $block ) { + name ...subscriptionRevokedEvent } } @@ -234,6 +245,7 @@ query subscriptionUnitsUpdatedEvents( where: $where block: $block ) { + name ...subscriptionUnitsUpdatedEvent } } @@ -254,6 +266,7 @@ query transferEvents( where: $where block: $block ) { + name ...transferEvent } } @@ -274,6 +287,7 @@ query tokenUpgradedEvents( where: $where block: $block ) { + name ...tokenUpgradedEvent } } @@ -294,6 +308,7 @@ query tokenDowngradedEvents( where: $where block: $block ) { + name ...tokenDowngradedEvent } } @@ -314,6 +329,7 @@ query agreementClassRegisteredEvents( where: $where block: $block ) { + name ...agreementClassRegisteredEvent } } @@ -334,6 +350,7 @@ query agreementClassUpdatedEvents( where: $where block: $block ) { + name ...agreementClassUpdatedEvent } } @@ -354,6 +371,7 @@ query appRegisteredEvents( where: $where block: $block ) { + name ...appRegisteredEvent } } @@ -374,6 +392,7 @@ query governanceReplacedEvents( where: $where block: $block ) { + name ...governanceReplacedEvent } } @@ -394,6 +413,7 @@ query jailEvents( where: $where block: $block ) { + name ...jailEvent } } @@ -414,6 +434,7 @@ query superTokenFactoryUpdatedEvents( where: $where block: $block ) { + name ...superTokenFactoryUpdatedEvent } } @@ -434,6 +455,7 @@ query superTokenLogicUpdatedEvents( where: $where block: $block ) { + name ...superTokenLogicUpdatedEvent } } @@ -454,6 +476,7 @@ query roleAdminChangedEvents( where: $where block: $block ) { + name ...roleAdminChangedEvent } } @@ -474,6 +497,7 @@ query roleGrantedEvents( where: $where block: $block ) { + name ...roleGrantedEvent } } @@ -494,6 +518,7 @@ query roleRevokedEvents( where: $where block: $block ) { + name ...roleRevokedEvent } } @@ -514,6 +539,7 @@ query setEvents( where: $where block: $block ) { + name ...setEvent } } @@ -534,6 +560,7 @@ query cfaV1LiquidationPeriodChangedEvents( where: $where block: $block ) { + name ...cfaV1LiquidationPeriodChangedEvent } } @@ -554,6 +581,7 @@ query configChangedEvents( where: $where block: $block ) { + name ...configChangedEvent } } @@ -574,6 +602,7 @@ query rewardAddressChangedEvents( where: $where block: $block ) { + name ...rewardAddressChangedEvent } } @@ -594,6 +623,7 @@ query superTokenMinimumDepositChangedEvents( where: $where block: $block ) { + name ...superTokenMinimumDepositChangedEvent } } @@ -614,6 +644,7 @@ query trustedForwarderChangedEvents( where: $where block: $block ) { + name ...trustedForwarderChangedEvent } } @@ -634,6 +665,7 @@ query agreementLiquidatedByEvents( where: $where block: $block ) { + name ...agreementLiquidatedByEvent } } @@ -654,6 +686,7 @@ query burnedEvents( where: $where block: $block ) { + name ...burnedEvent } } @@ -674,6 +707,7 @@ query mintedEvents( where: $where block: $block ) { + name ...mintedEvent } } @@ -694,6 +728,7 @@ query sentEvents( where: $where block: $block ) { + name ...sentEvent } } @@ -714,6 +749,7 @@ query customSuperTokenCreatedEvents( where: $where block: $block ) { + name ...customSuperTokenCreatedEvent } } @@ -734,6 +770,7 @@ query superTokenCreatedEvents( where: $where block: $block ) { + name ...superTokenCreatedEvent } } @@ -754,6 +791,7 @@ query superTokenLogicCreatedEvents( where: $where block: $block ) { + name ...superTokenLogicCreatedEvent } } @@ -774,6 +812,7 @@ query newPICEvents( where: $where block: $block ) { + name ...newPICEvent } } @@ -794,6 +833,7 @@ query exitRateChangedEvents( where: $where block: $block ) { + name ...newExitRateChangedEvent } } @@ -814,6 +854,7 @@ query bondIncreasedEvents( where: $where block: $block ) { + name ...newBondIncreasedEvent } } @@ -838,6 +879,7 @@ query events( blockNumber transactionHash timestamp + name ... on FlowUpdatedEvent { ...flowUpdatedEvent } @@ -1165,6 +1207,7 @@ fragment transferEvent on TransferEvent { ...eventFields value token + isNFTTransfer to { id } @@ -1436,6 +1479,7 @@ fragment memberUnitsUpdatedEvent on MemberUnitsUpdatedEvent { } fragment approvalEvent on ApprovalEvent { ...eventFields + isNFTApproval } fragment approvalForAllEvent on ApprovalForAllEvent { ...eventFields diff --git a/packages/sdk-core/src/subgraph/queries/getAllEvents.graphql b/packages/sdk-core/src/subgraph/queries/getAllEvents.graphql index 0a792a833d..3846b67f48 100644 --- a/packages/sdk-core/src/subgraph/queries/getAllEvents.graphql +++ b/packages/sdk-core/src/subgraph/queries/getAllEvents.graphql @@ -12,6 +12,7 @@ query getAllEvents( orderBy: $orderBy orderDirection: $orderDirection ) { + name ... on FlowUpdatedEvent { # we repeat `...eventFields` in each event so it throws an error in the mapper when an expected event isn't included here ...eventFields @@ -161,6 +162,7 @@ query getAllEvents( from { id } + isNFTTransfer } ... on TokenUpgradedEvent { ...eventFields @@ -396,6 +398,7 @@ query getAllEvents( ...eventFields } ... on ApprovalEvent { + isNFTApproval ...eventFields } ... on ApprovalForAllEvent { diff --git a/packages/sdk-core/src/subgraph/schema.graphql b/packages/sdk-core/src/subgraph/schema.graphql index 7d73de9331..7c93eab6f2 100644 --- a/packages/sdk-core/src/subgraph/schema.graphql +++ b/packages/sdk-core/src/subgraph/schema.graphql @@ -21,6 +21,9 @@ type _Block_ { """Integer representation of the timestamp stored in blocks for the chain""" timestamp: Int + + """The hash of the parent block""" + parentHash: Bytes } """The type for the top-level _meta field""" @@ -227,23 +230,12 @@ type AccountTokenSnapshot { """ activeGDAOutgoingStreamCount: Int! - """ - The count of active incoming streams to this account for all agreements. - - """ - activeIncomingStreamCount: Int! - """ The count of active incoming streams to this account for the CFA. + GDA incoming streams are *NOT* counted here. """ - activeCFAIncomingStreamCount: Int! - - """ - The count of active incoming streams to this account for the GDA. - - """ - activeGDAIncomingStreamCount: Int! + activeIncomingStreamCount: Int! """ The count of closed streams by `account`, both incoming and outgoing for all agreements. @@ -281,23 +273,12 @@ type AccountTokenSnapshot { """ inactiveGDAOutgoingStreamCount: Int! - """ - The count of closed incoming streams by `account` for all agreements. - - """ - inactiveIncomingStreamCount: Int! - """ The count of closed incoming streams by `account` for the CFA. + Close incoming GDA streams are *NOT* counted here. """ - inactiveCFAIncomingStreamCount: Int! - - """ - The count of closed incoming streams by `account` for the GDA. - - """ - inactiveGDAIncomingStreamCount: Int! + inactiveIncomingStreamCount: Int! """ The current (as of updatedAt) number of subscriptions with units allocated to them tied to this `account`. @@ -350,6 +331,7 @@ type AccountTokenSnapshot { """ The total net flow rate of the `account` as of `updatedAtTimestamp`/`updatedAtBlock` for all flow agreements. This can be obtained by: `totalInflowRate - totalOutflowRate`. + NOTE: this property will NOT be 100% accurate all the time for receivers of GDA flows. """ totalNetFlowRate: BigInt! @@ -360,29 +342,12 @@ type AccountTokenSnapshot { """ totalCFANetFlowRate: BigInt! - """ - The total net flow rate of the `account` as of `updatedAtTimestamp`/`updatedAtBlock` for the GDA. - - """ - totalGDANetFlowRate: BigInt! - - """ - The total inflow rate (receive flowRate per second) of the `account` for all flow agreements. - - """ - totalInflowRate: BigInt! - """ The total inflow rate (receive flowRate per second) of the `account` for the CFA. + GDA inflow rate is *NOT* included here. """ - totalCFAInflowRate: BigInt! - - """ - The total inflow rate (receive flowRate per second) of the `account` for the GDA. - - """ - totalGDAInflowRate: BigInt! + totalInflowRate: BigInt! """ The total outflow rate (send flowrate per second) of the `account` for all flow agreements. @@ -402,24 +367,11 @@ type AccountTokenSnapshot { """ totalGDAOutflowRate: BigInt! - """ - The total amount of `token` streamed into this `account` until the - `updatedAtTimestamp`/`updatedAtBlock` for all flow agreements. - - """ - totalAmountStreamedInUntilUpdatedAt: BigInt! - """ The total amount of `token` streamed into this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for the CFA. """ - totalCFAAmountStreamedInUntilUpdatedAt: BigInt! - - """ - The total amount of `token` streamed into this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for the GDA. - - """ - totalGDAAmountStreamedInUntilUpdatedAt: BigInt! + totalAmountStreamedInUntilUpdatedAt: BigInt! """ The total amount of `token` streamed from this `account` until the @@ -434,12 +386,6 @@ type AccountTokenSnapshot { """ totalCFAAmountStreamedOutUntilUpdatedAt: BigInt! - """ - The total amount of `token` streamed from this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for the GDA. - - """ - totalGDAAmountStreamedOutUntilUpdatedAt: BigInt! - """ The total amount of `token` streamed through this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for all flow agreements. @@ -453,12 +399,6 @@ type AccountTokenSnapshot { """ totalCFAAmountStreamedUntilUpdatedAt: BigInt! - """ - The total amount of `token` streamed through this `account` until the `updatedAtTimestamp`/`updatedAtBlock` for the GDA. - - """ - totalGDAAmountStreamedUntilUpdatedAt: BigInt! - """ The total amount of `token` this `account` has transferred. @@ -563,22 +503,6 @@ input AccountTokenSnapshot_filter { activeIncomingStreamCount_lte: Int activeIncomingStreamCount_in: [Int!] activeIncomingStreamCount_not_in: [Int!] - activeCFAIncomingStreamCount: Int - activeCFAIncomingStreamCount_not: Int - activeCFAIncomingStreamCount_gt: Int - activeCFAIncomingStreamCount_lt: Int - activeCFAIncomingStreamCount_gte: Int - activeCFAIncomingStreamCount_lte: Int - activeCFAIncomingStreamCount_in: [Int!] - activeCFAIncomingStreamCount_not_in: [Int!] - activeGDAIncomingStreamCount: Int - activeGDAIncomingStreamCount_not: Int - activeGDAIncomingStreamCount_gt: Int - activeGDAIncomingStreamCount_lt: Int - activeGDAIncomingStreamCount_gte: Int - activeGDAIncomingStreamCount_lte: Int - activeGDAIncomingStreamCount_in: [Int!] - activeGDAIncomingStreamCount_not_in: [Int!] totalNumberOfClosedStreams: Int totalNumberOfClosedStreams_not: Int totalNumberOfClosedStreams_gt: Int @@ -635,22 +559,6 @@ input AccountTokenSnapshot_filter { inactiveIncomingStreamCount_lte: Int inactiveIncomingStreamCount_in: [Int!] inactiveIncomingStreamCount_not_in: [Int!] - inactiveCFAIncomingStreamCount: Int - inactiveCFAIncomingStreamCount_not: Int - inactiveCFAIncomingStreamCount_gt: Int - inactiveCFAIncomingStreamCount_lt: Int - inactiveCFAIncomingStreamCount_gte: Int - inactiveCFAIncomingStreamCount_lte: Int - inactiveCFAIncomingStreamCount_in: [Int!] - inactiveCFAIncomingStreamCount_not_in: [Int!] - inactiveGDAIncomingStreamCount: Int - inactiveGDAIncomingStreamCount_not: Int - inactiveGDAIncomingStreamCount_gt: Int - inactiveGDAIncomingStreamCount_lt: Int - inactiveGDAIncomingStreamCount_gte: Int - inactiveGDAIncomingStreamCount_lte: Int - inactiveGDAIncomingStreamCount_in: [Int!] - inactiveGDAIncomingStreamCount_not_in: [Int!] totalSubscriptionsWithUnits: Int totalSubscriptionsWithUnits_not: Int totalSubscriptionsWithUnits_gt: Int @@ -731,14 +639,6 @@ input AccountTokenSnapshot_filter { totalCFANetFlowRate_lte: BigInt totalCFANetFlowRate_in: [BigInt!] totalCFANetFlowRate_not_in: [BigInt!] - totalGDANetFlowRate: BigInt - totalGDANetFlowRate_not: BigInt - totalGDANetFlowRate_gt: BigInt - totalGDANetFlowRate_lt: BigInt - totalGDANetFlowRate_gte: BigInt - totalGDANetFlowRate_lte: BigInt - totalGDANetFlowRate_in: [BigInt!] - totalGDANetFlowRate_not_in: [BigInt!] totalInflowRate: BigInt totalInflowRate_not: BigInt totalInflowRate_gt: BigInt @@ -747,22 +647,6 @@ input AccountTokenSnapshot_filter { totalInflowRate_lte: BigInt totalInflowRate_in: [BigInt!] totalInflowRate_not_in: [BigInt!] - totalCFAInflowRate: BigInt - totalCFAInflowRate_not: BigInt - totalCFAInflowRate_gt: BigInt - totalCFAInflowRate_lt: BigInt - totalCFAInflowRate_gte: BigInt - totalCFAInflowRate_lte: BigInt - totalCFAInflowRate_in: [BigInt!] - totalCFAInflowRate_not_in: [BigInt!] - totalGDAInflowRate: BigInt - totalGDAInflowRate_not: BigInt - totalGDAInflowRate_gt: BigInt - totalGDAInflowRate_lt: BigInt - totalGDAInflowRate_gte: BigInt - totalGDAInflowRate_lte: BigInt - totalGDAInflowRate_in: [BigInt!] - totalGDAInflowRate_not_in: [BigInt!] totalOutflowRate: BigInt totalOutflowRate_not: BigInt totalOutflowRate_gt: BigInt @@ -795,22 +679,6 @@ input AccountTokenSnapshot_filter { totalAmountStreamedInUntilUpdatedAt_lte: BigInt totalAmountStreamedInUntilUpdatedAt_in: [BigInt!] totalAmountStreamedInUntilUpdatedAt_not_in: [BigInt!] - totalCFAAmountStreamedInUntilUpdatedAt: BigInt - totalCFAAmountStreamedInUntilUpdatedAt_not: BigInt - totalCFAAmountStreamedInUntilUpdatedAt_gt: BigInt - totalCFAAmountStreamedInUntilUpdatedAt_lt: BigInt - totalCFAAmountStreamedInUntilUpdatedAt_gte: BigInt - totalCFAAmountStreamedInUntilUpdatedAt_lte: BigInt - totalCFAAmountStreamedInUntilUpdatedAt_in: [BigInt!] - totalCFAAmountStreamedInUntilUpdatedAt_not_in: [BigInt!] - totalGDAAmountStreamedInUntilUpdatedAt: BigInt - totalGDAAmountStreamedInUntilUpdatedAt_not: BigInt - totalGDAAmountStreamedInUntilUpdatedAt_gt: BigInt - totalGDAAmountStreamedInUntilUpdatedAt_lt: BigInt - totalGDAAmountStreamedInUntilUpdatedAt_gte: BigInt - totalGDAAmountStreamedInUntilUpdatedAt_lte: BigInt - totalGDAAmountStreamedInUntilUpdatedAt_in: [BigInt!] - totalGDAAmountStreamedInUntilUpdatedAt_not_in: [BigInt!] totalAmountStreamedOutUntilUpdatedAt: BigInt totalAmountStreamedOutUntilUpdatedAt_not: BigInt totalAmountStreamedOutUntilUpdatedAt_gt: BigInt @@ -827,14 +695,6 @@ input AccountTokenSnapshot_filter { totalCFAAmountStreamedOutUntilUpdatedAt_lte: BigInt totalCFAAmountStreamedOutUntilUpdatedAt_in: [BigInt!] totalCFAAmountStreamedOutUntilUpdatedAt_not_in: [BigInt!] - totalGDAAmountStreamedOutUntilUpdatedAt: BigInt - totalGDAAmountStreamedOutUntilUpdatedAt_not: BigInt - totalGDAAmountStreamedOutUntilUpdatedAt_gt: BigInt - totalGDAAmountStreamedOutUntilUpdatedAt_lt: BigInt - totalGDAAmountStreamedOutUntilUpdatedAt_gte: BigInt - totalGDAAmountStreamedOutUntilUpdatedAt_lte: BigInt - totalGDAAmountStreamedOutUntilUpdatedAt_in: [BigInt!] - totalGDAAmountStreamedOutUntilUpdatedAt_not_in: [BigInt!] totalAmountStreamedUntilUpdatedAt: BigInt totalAmountStreamedUntilUpdatedAt_not: BigInt totalAmountStreamedUntilUpdatedAt_gt: BigInt @@ -851,14 +711,6 @@ input AccountTokenSnapshot_filter { totalCFAAmountStreamedUntilUpdatedAt_lte: BigInt totalCFAAmountStreamedUntilUpdatedAt_in: [BigInt!] totalCFAAmountStreamedUntilUpdatedAt_not_in: [BigInt!] - totalGDAAmountStreamedUntilUpdatedAt: BigInt - totalGDAAmountStreamedUntilUpdatedAt_not: BigInt - totalGDAAmountStreamedUntilUpdatedAt_gt: BigInt - totalGDAAmountStreamedUntilUpdatedAt_lt: BigInt - totalGDAAmountStreamedUntilUpdatedAt_gte: BigInt - totalGDAAmountStreamedUntilUpdatedAt_lte: BigInt - totalGDAAmountStreamedUntilUpdatedAt_in: [BigInt!] - totalGDAAmountStreamedUntilUpdatedAt_not_in: [BigInt!] totalAmountTransferredUntilUpdatedAt: BigInt totalAmountTransferredUntilUpdatedAt_not: BigInt totalAmountTransferredUntilUpdatedAt_gt: BigInt @@ -931,8 +783,6 @@ enum AccountTokenSnapshot_orderBy { activeCFAOutgoingStreamCount activeGDAOutgoingStreamCount activeIncomingStreamCount - activeCFAIncomingStreamCount - activeGDAIncomingStreamCount totalNumberOfClosedStreams totalCFANumberOfClosedStreams totalGDANumberOfClosedStreams @@ -940,8 +790,6 @@ enum AccountTokenSnapshot_orderBy { inactiveCFAOutgoingStreamCount inactiveGDAOutgoingStreamCount inactiveIncomingStreamCount - inactiveCFAIncomingStreamCount - inactiveGDAIncomingStreamCount totalSubscriptionsWithUnits totalApprovedSubscriptions totalMembershipsWithUnits @@ -952,22 +800,15 @@ enum AccountTokenSnapshot_orderBy { totalGDADeposit totalNetFlowRate totalCFANetFlowRate - totalGDANetFlowRate totalInflowRate - totalCFAInflowRate - totalGDAInflowRate totalOutflowRate totalCFAOutflowRate totalGDAOutflowRate totalAmountStreamedInUntilUpdatedAt - totalCFAAmountStreamedInUntilUpdatedAt - totalGDAAmountStreamedInUntilUpdatedAt totalAmountStreamedOutUntilUpdatedAt totalCFAAmountStreamedOutUntilUpdatedAt - totalGDAAmountStreamedOutUntilUpdatedAt totalAmountStreamedUntilUpdatedAt totalCFAAmountStreamedUntilUpdatedAt - totalGDAAmountStreamedUntilUpdatedAt totalAmountTransferredUntilUpdatedAt account account__id @@ -1052,18 +893,6 @@ type AccountTokenSnapshotLog { """ activeIncomingStreamCount: Int! - """ - The count of active incoming streams to this account for the CFA. - - """ - activeCFAIncomingStreamCount: Int! - - """ - The count of active incoming streams to this account for the GDA. - - """ - activeGDAIncomingStreamCount: Int! - """ The current (as of timestamp) count of closed streams for all agreements. @@ -1100,23 +929,12 @@ type AccountTokenSnapshotLog { """ inactiveGDAOutgoingStreamCount: Int! - """ - The count of closed incoming streams by `account` for all agreements. - - """ - inactiveIncomingStreamCount: Int! - """ The count of closed incoming streams by `account` for the CFA. + Close incoming GDA streams are *NOT* counted here. """ - inactiveCFAIncomingStreamCount: Int! - - """ - The count of closed incoming streams by `account` for the GDA. - - """ - inactiveGDAIncomingStreamCount: Int! + inactiveIncomingStreamCount: Int! """ The current (as of timestamp) number of subscriptions with units allocated to them tied to this `account`. @@ -1175,36 +993,16 @@ type AccountTokenSnapshotLog { """ The total (as of timestamp) net flow rate of the `account` as of `timestamp`/`block` for the CFA. - This can be obtained by: `totalCFAInflowRate - totalCFAOutflowRate` """ totalCFANetFlowRate: BigInt! - """ - The total (as of timestamp) net flow rate of the `account` as of `timestamp`/`block` for the GDA. - This can be obtained by: `totalGDAInflowRate - totalGDAOutflowRate` - - """ - totalGDANetFlowRate: BigInt! - """ The total (as of timestamp) inflow rate (receive flowRate per second) of the `account`. """ totalInflowRate: BigInt! - """ - The total (as of timestamp) inflow rate (receive flowRate per second) of the `account` for the CFA. - - """ - totalCFAInflowRate: BigInt! - - """ - The total (as of timestamp) inflow rate (receive flowRate per second) of the `account` for the GDA. - - """ - totalGDAInflowRate: BigInt! - """ The total (as of timestamp) outflow rate (send flowrate per second) of the `account`. @@ -1229,18 +1027,6 @@ type AccountTokenSnapshotLog { """ totalAmountStreamedIn: BigInt! - """ - The total (as of timestamp) amount of `token` streamed into this `account` until the `timestamp`/`block` for the CFA. - - """ - totalCFAAmountStreamedIn: BigInt! - - """ - The total (as of timestamp) amount of `token` streamed into this `account` until the `timestamp`/`block` for the GDA. - - """ - totalGDAAmountStreamedIn: BigInt! - """ The total (as of timestamp) amount of `token` streamed from this `account` until the `timestamp`/`block`. @@ -1253,12 +1039,6 @@ type AccountTokenSnapshotLog { """ totalCFAAmountStreamedOut: BigInt! - """ - The total (as of timestamp) amount of `token` streamed from this `account` until the `timestamp`/`block` for the GDA. - - """ - totalGDAAmountStreamedOut: BigInt! - """ The total (as of timestamp) net amount of `token` streamed through this `account` until the `timestamp`/`block`. @@ -1272,13 +1052,6 @@ type AccountTokenSnapshotLog { """ totalCFAAmountStreamed: BigInt! - """ - The total (as of timestamp) net amount of `token` streamed through this - `account` until the `timestamp`/`block` for the GDA. - - """ - totalGDAAmountStreamed: BigInt! - """ The total (as of timestamp) amount of `token` this `account` has transferred out until the `timestamp`/`block`. @@ -1424,22 +1197,6 @@ input AccountTokenSnapshotLog_filter { activeIncomingStreamCount_lte: Int activeIncomingStreamCount_in: [Int!] activeIncomingStreamCount_not_in: [Int!] - activeCFAIncomingStreamCount: Int - activeCFAIncomingStreamCount_not: Int - activeCFAIncomingStreamCount_gt: Int - activeCFAIncomingStreamCount_lt: Int - activeCFAIncomingStreamCount_gte: Int - activeCFAIncomingStreamCount_lte: Int - activeCFAIncomingStreamCount_in: [Int!] - activeCFAIncomingStreamCount_not_in: [Int!] - activeGDAIncomingStreamCount: Int - activeGDAIncomingStreamCount_not: Int - activeGDAIncomingStreamCount_gt: Int - activeGDAIncomingStreamCount_lt: Int - activeGDAIncomingStreamCount_gte: Int - activeGDAIncomingStreamCount_lte: Int - activeGDAIncomingStreamCount_in: [Int!] - activeGDAIncomingStreamCount_not_in: [Int!] totalNumberOfClosedStreams: Int totalNumberOfClosedStreams_not: Int totalNumberOfClosedStreams_gt: Int @@ -1496,22 +1253,6 @@ input AccountTokenSnapshotLog_filter { inactiveIncomingStreamCount_lte: Int inactiveIncomingStreamCount_in: [Int!] inactiveIncomingStreamCount_not_in: [Int!] - inactiveCFAIncomingStreamCount: Int - inactiveCFAIncomingStreamCount_not: Int - inactiveCFAIncomingStreamCount_gt: Int - inactiveCFAIncomingStreamCount_lt: Int - inactiveCFAIncomingStreamCount_gte: Int - inactiveCFAIncomingStreamCount_lte: Int - inactiveCFAIncomingStreamCount_in: [Int!] - inactiveCFAIncomingStreamCount_not_in: [Int!] - inactiveGDAIncomingStreamCount: Int - inactiveGDAIncomingStreamCount_not: Int - inactiveGDAIncomingStreamCount_gt: Int - inactiveGDAIncomingStreamCount_lt: Int - inactiveGDAIncomingStreamCount_gte: Int - inactiveGDAIncomingStreamCount_lte: Int - inactiveGDAIncomingStreamCount_in: [Int!] - inactiveGDAIncomingStreamCount_not_in: [Int!] totalSubscriptionsWithUnits: Int totalSubscriptionsWithUnits_not: Int totalSubscriptionsWithUnits_gt: Int @@ -1592,14 +1333,6 @@ input AccountTokenSnapshotLog_filter { totalCFANetFlowRate_lte: BigInt totalCFANetFlowRate_in: [BigInt!] totalCFANetFlowRate_not_in: [BigInt!] - totalGDANetFlowRate: BigInt - totalGDANetFlowRate_not: BigInt - totalGDANetFlowRate_gt: BigInt - totalGDANetFlowRate_lt: BigInt - totalGDANetFlowRate_gte: BigInt - totalGDANetFlowRate_lte: BigInt - totalGDANetFlowRate_in: [BigInt!] - totalGDANetFlowRate_not_in: [BigInt!] totalInflowRate: BigInt totalInflowRate_not: BigInt totalInflowRate_gt: BigInt @@ -1608,22 +1341,6 @@ input AccountTokenSnapshotLog_filter { totalInflowRate_lte: BigInt totalInflowRate_in: [BigInt!] totalInflowRate_not_in: [BigInt!] - totalCFAInflowRate: BigInt - totalCFAInflowRate_not: BigInt - totalCFAInflowRate_gt: BigInt - totalCFAInflowRate_lt: BigInt - totalCFAInflowRate_gte: BigInt - totalCFAInflowRate_lte: BigInt - totalCFAInflowRate_in: [BigInt!] - totalCFAInflowRate_not_in: [BigInt!] - totalGDAInflowRate: BigInt - totalGDAInflowRate_not: BigInt - totalGDAInflowRate_gt: BigInt - totalGDAInflowRate_lt: BigInt - totalGDAInflowRate_gte: BigInt - totalGDAInflowRate_lte: BigInt - totalGDAInflowRate_in: [BigInt!] - totalGDAInflowRate_not_in: [BigInt!] totalOutflowRate: BigInt totalOutflowRate_not: BigInt totalOutflowRate_gt: BigInt @@ -1656,22 +1373,6 @@ input AccountTokenSnapshotLog_filter { totalAmountStreamedIn_lte: BigInt totalAmountStreamedIn_in: [BigInt!] totalAmountStreamedIn_not_in: [BigInt!] - totalCFAAmountStreamedIn: BigInt - totalCFAAmountStreamedIn_not: BigInt - totalCFAAmountStreamedIn_gt: BigInt - totalCFAAmountStreamedIn_lt: BigInt - totalCFAAmountStreamedIn_gte: BigInt - totalCFAAmountStreamedIn_lte: BigInt - totalCFAAmountStreamedIn_in: [BigInt!] - totalCFAAmountStreamedIn_not_in: [BigInt!] - totalGDAAmountStreamedIn: BigInt - totalGDAAmountStreamedIn_not: BigInt - totalGDAAmountStreamedIn_gt: BigInt - totalGDAAmountStreamedIn_lt: BigInt - totalGDAAmountStreamedIn_gte: BigInt - totalGDAAmountStreamedIn_lte: BigInt - totalGDAAmountStreamedIn_in: [BigInt!] - totalGDAAmountStreamedIn_not_in: [BigInt!] totalAmountStreamedOut: BigInt totalAmountStreamedOut_not: BigInt totalAmountStreamedOut_gt: BigInt @@ -1688,14 +1389,6 @@ input AccountTokenSnapshotLog_filter { totalCFAAmountStreamedOut_lte: BigInt totalCFAAmountStreamedOut_in: [BigInt!] totalCFAAmountStreamedOut_not_in: [BigInt!] - totalGDAAmountStreamedOut: BigInt - totalGDAAmountStreamedOut_not: BigInt - totalGDAAmountStreamedOut_gt: BigInt - totalGDAAmountStreamedOut_lt: BigInt - totalGDAAmountStreamedOut_gte: BigInt - totalGDAAmountStreamedOut_lte: BigInt - totalGDAAmountStreamedOut_in: [BigInt!] - totalGDAAmountStreamedOut_not_in: [BigInt!] totalAmountStreamed: BigInt totalAmountStreamed_not: BigInt totalAmountStreamed_gt: BigInt @@ -1712,14 +1405,6 @@ input AccountTokenSnapshotLog_filter { totalCFAAmountStreamed_lte: BigInt totalCFAAmountStreamed_in: [BigInt!] totalCFAAmountStreamed_not_in: [BigInt!] - totalGDAAmountStreamed: BigInt - totalGDAAmountStreamed_not: BigInt - totalGDAAmountStreamed_gt: BigInt - totalGDAAmountStreamed_lt: BigInt - totalGDAAmountStreamed_gte: BigInt - totalGDAAmountStreamed_lte: BigInt - totalGDAAmountStreamed_in: [BigInt!] - totalGDAAmountStreamed_not_in: [BigInt!] totalAmountTransferred: BigInt totalAmountTransferred_not: BigInt totalAmountTransferred_gt: BigInt @@ -1814,8 +1499,6 @@ enum AccountTokenSnapshotLog_orderBy { activeCFAOutgoingStreamCount activeGDAOutgoingStreamCount activeIncomingStreamCount - activeCFAIncomingStreamCount - activeGDAIncomingStreamCount totalNumberOfClosedStreams totalCFANumberOfClosedStreams totalGDANumberOfClosedStreams @@ -1823,8 +1506,6 @@ enum AccountTokenSnapshotLog_orderBy { inactiveCFAOutgoingStreamCount inactiveGDAOutgoingStreamCount inactiveIncomingStreamCount - inactiveCFAIncomingStreamCount - inactiveGDAIncomingStreamCount totalSubscriptionsWithUnits totalApprovedSubscriptions totalMembershipsWithUnits @@ -1835,22 +1516,15 @@ enum AccountTokenSnapshotLog_orderBy { totalGDADeposit totalNetFlowRate totalCFANetFlowRate - totalGDANetFlowRate totalInflowRate - totalCFAInflowRate - totalGDAInflowRate totalOutflowRate totalCFAOutflowRate totalGDAOutflowRate totalAmountStreamedIn - totalCFAAmountStreamedIn - totalGDAAmountStreamedIn totalAmountStreamedOut totalCFAAmountStreamedOut - totalGDAAmountStreamedOut totalAmountStreamed totalCFAAmountStreamed - totalGDAAmountStreamed totalAmountTransferred account account__id @@ -1883,8 +1557,6 @@ enum AccountTokenSnapshotLog_orderBy { accountTokenSnapshot__activeCFAOutgoingStreamCount accountTokenSnapshot__activeGDAOutgoingStreamCount accountTokenSnapshot__activeIncomingStreamCount - accountTokenSnapshot__activeCFAIncomingStreamCount - accountTokenSnapshot__activeGDAIncomingStreamCount accountTokenSnapshot__totalNumberOfClosedStreams accountTokenSnapshot__totalCFANumberOfClosedStreams accountTokenSnapshot__totalGDANumberOfClosedStreams @@ -1892,8 +1564,6 @@ enum AccountTokenSnapshotLog_orderBy { accountTokenSnapshot__inactiveCFAOutgoingStreamCount accountTokenSnapshot__inactiveGDAOutgoingStreamCount accountTokenSnapshot__inactiveIncomingStreamCount - accountTokenSnapshot__inactiveCFAIncomingStreamCount - accountTokenSnapshot__inactiveGDAIncomingStreamCount accountTokenSnapshot__totalSubscriptionsWithUnits accountTokenSnapshot__totalApprovedSubscriptions accountTokenSnapshot__totalMembershipsWithUnits @@ -1904,25 +1574,23 @@ enum AccountTokenSnapshotLog_orderBy { accountTokenSnapshot__totalGDADeposit accountTokenSnapshot__totalNetFlowRate accountTokenSnapshot__totalCFANetFlowRate - accountTokenSnapshot__totalGDANetFlowRate accountTokenSnapshot__totalInflowRate - accountTokenSnapshot__totalCFAInflowRate - accountTokenSnapshot__totalGDAInflowRate accountTokenSnapshot__totalOutflowRate accountTokenSnapshot__totalCFAOutflowRate accountTokenSnapshot__totalGDAOutflowRate accountTokenSnapshot__totalAmountStreamedInUntilUpdatedAt - accountTokenSnapshot__totalCFAAmountStreamedInUntilUpdatedAt - accountTokenSnapshot__totalGDAAmountStreamedInUntilUpdatedAt accountTokenSnapshot__totalAmountStreamedOutUntilUpdatedAt accountTokenSnapshot__totalCFAAmountStreamedOutUntilUpdatedAt - accountTokenSnapshot__totalGDAAmountStreamedOutUntilUpdatedAt accountTokenSnapshot__totalAmountStreamedUntilUpdatedAt accountTokenSnapshot__totalCFAAmountStreamedUntilUpdatedAt - accountTokenSnapshot__totalGDAAmountStreamedUntilUpdatedAt accountTokenSnapshot__totalAmountTransferredUntilUpdatedAt } +enum Aggregation_interval { + hour + day +} + type AgreementClassRegisteredEvent implements Event { id: ID! transactionHash: Bytes! @@ -1932,7 +1600,8 @@ type AgreementClassRegisteredEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `code` """ addresses: [Bytes!]! @@ -2087,7 +1756,8 @@ type AgreementClassUpdatedEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `code` """ addresses: [Bytes!]! @@ -2800,7 +2470,8 @@ type AppRegisteredEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `app` """ addresses: [Bytes!]! @@ -2943,22 +2614,44 @@ type ApprovalEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `isNFTApproval` ? `nft address` : `token` (superToken) + addresses[1] = `owner` + addresses[2] = `to` """ addresses: [Bytes!]! blockNumber: BigInt! logIndex: BigInt! order: BigInt! + + """ + The address that will be granting allowance to transfer ERC20/NFT. + + """ owner: Account! """ - The address that will be granted allowance to transfer the NFT. + The address that will be granted allowance to transfer ERC20/NFT. """ to: Account! """ + Indicates whether the event was emitted for the approval of an NFT. + + """ + isNFTApproval: Boolean! + + """ + If `amount` is non-zero, this event was emitted for the approval of an ERC20. + Tne amount of ERC20 tokens that will be granted allowance to transfer. + + """ + amount: BigInt! + + """ + If `tokenId` is non-zero, this event was emitted for the approval of an NFT. The id of the NFT that will be granted allowance to transfer. The id is: uint256(keccak256(abi.encode(block.chainid, superToken, sender, receiver))) @@ -3101,6 +2794,18 @@ input ApprovalEvent_filter { to_not_ends_with: String to_not_ends_with_nocase: String to_: Account_filter + isNFTApproval: Boolean + isNFTApproval_not: Boolean + isNFTApproval_in: [Boolean!] + isNFTApproval_not_in: [Boolean!] + amount: BigInt + amount_not: BigInt + amount_gt: BigInt + amount_lt: BigInt + amount_gte: BigInt + amount_lte: BigInt + amount_in: [BigInt!] + amount_not_in: [BigInt!] tokenId: BigInt tokenId_not: BigInt tokenId_gt: BigInt @@ -3141,6 +2846,8 @@ enum ApprovalEvent_orderBy { to__updatedAtTimestamp to__updatedAtBlockNumber to__isSuperApp + isNFTApproval + amount tokenId } @@ -3153,7 +2860,10 @@ type ApprovalForAllEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = NFT address + addresses[1] = `owner` + addresses[2] = `operator` """ addresses: [Bytes!]! @@ -3758,6 +3468,9 @@ enum BufferAdjustedEvent_orderBy { pool__totalAmountInstantlyDistributedUntilUpdatedAt pool__totalAmountFlowedDistributedUntilUpdatedAt pool__totalAmountDistributedUntilUpdatedAt + pool__totalFlowAdjustmentAmountDistributedUntilUpdatedAt + pool__perUnitSettledValue + pool__perUnitFlowRate pool__totalMembers pool__totalConnectedMembers pool__totalDisconnectedMembers @@ -3997,7 +3710,10 @@ type CFAv1LiquidationPeriodChangedEvent implements Event { governanceAddress: Bytes! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `governanceAddress` + addresses[1] = `host` + addresses[2] = `superToken` """ addresses: [Bytes!]! @@ -4185,7 +3901,10 @@ type ConfigChangedEvent implements Event { governanceAddress: Bytes! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `governanceAddress` + addresses[1] = `host` + addresses[2] = `superToken` """ addresses: [Bytes!]! @@ -4734,6 +4453,9 @@ enum DistributionClaimedEvent_orderBy { pool__totalAmountInstantlyDistributedUntilUpdatedAt pool__totalAmountFlowedDistributedUntilUpdatedAt pool__totalAmountDistributedUntilUpdatedAt + pool__totalFlowAdjustmentAmountDistributedUntilUpdatedAt + pool__perUnitSettledValue + pool__perUnitFlowRate pool__totalMembers pool__totalConnectedMembers pool__totalDisconnectedMembers @@ -4751,6 +4473,8 @@ enum DistributionClaimedEvent_orderBy { poolMember__totalAmountClaimed poolMember__poolTotalAmountDistributedUntilUpdatedAt poolMember__totalAmountReceivedUntilUpdatedAt + poolMember__syncedPerUnitSettledValue + poolMember__syncedPerUnitFlowRate } """ @@ -5386,6 +5110,9 @@ enum FlowDistributionUpdatedEvent_orderBy { pool__totalAmountInstantlyDistributedUntilUpdatedAt pool__totalAmountFlowedDistributedUntilUpdatedAt pool__totalAmountDistributedUntilUpdatedAt + pool__totalFlowAdjustmentAmountDistributedUntilUpdatedAt + pool__perUnitSettledValue + pool__perUnitFlowRate pool__totalMembers pool__totalConnectedMembers pool__totalDisconnectedMembers @@ -5655,8 +5382,6 @@ enum FlowOperator_orderBy { accountTokenSnapshot__activeCFAOutgoingStreamCount accountTokenSnapshot__activeGDAOutgoingStreamCount accountTokenSnapshot__activeIncomingStreamCount - accountTokenSnapshot__activeCFAIncomingStreamCount - accountTokenSnapshot__activeGDAIncomingStreamCount accountTokenSnapshot__totalNumberOfClosedStreams accountTokenSnapshot__totalCFANumberOfClosedStreams accountTokenSnapshot__totalGDANumberOfClosedStreams @@ -5664,8 +5389,6 @@ enum FlowOperator_orderBy { accountTokenSnapshot__inactiveCFAOutgoingStreamCount accountTokenSnapshot__inactiveGDAOutgoingStreamCount accountTokenSnapshot__inactiveIncomingStreamCount - accountTokenSnapshot__inactiveCFAIncomingStreamCount - accountTokenSnapshot__inactiveGDAIncomingStreamCount accountTokenSnapshot__totalSubscriptionsWithUnits accountTokenSnapshot__totalApprovedSubscriptions accountTokenSnapshot__totalMembershipsWithUnits @@ -5676,22 +5399,15 @@ enum FlowOperator_orderBy { accountTokenSnapshot__totalGDADeposit accountTokenSnapshot__totalNetFlowRate accountTokenSnapshot__totalCFANetFlowRate - accountTokenSnapshot__totalGDANetFlowRate accountTokenSnapshot__totalInflowRate - accountTokenSnapshot__totalCFAInflowRate - accountTokenSnapshot__totalGDAInflowRate accountTokenSnapshot__totalOutflowRate accountTokenSnapshot__totalCFAOutflowRate accountTokenSnapshot__totalGDAOutflowRate accountTokenSnapshot__totalAmountStreamedInUntilUpdatedAt - accountTokenSnapshot__totalCFAAmountStreamedInUntilUpdatedAt - accountTokenSnapshot__totalGDAAmountStreamedInUntilUpdatedAt accountTokenSnapshot__totalAmountStreamedOutUntilUpdatedAt accountTokenSnapshot__totalCFAAmountStreamedOutUntilUpdatedAt - accountTokenSnapshot__totalGDAAmountStreamedOutUntilUpdatedAt accountTokenSnapshot__totalAmountStreamedUntilUpdatedAt accountTokenSnapshot__totalCFAAmountStreamedUntilUpdatedAt - accountTokenSnapshot__totalGDAAmountStreamedUntilUpdatedAt accountTokenSnapshot__totalAmountTransferredUntilUpdatedAt flowOperatorUpdatedEvents } @@ -6301,7 +6017,9 @@ type GovernanceReplacedEvent implements Event { order: BigInt! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `oldGovernance` + addresses[1] = `newGovernance` """ addresses: [Bytes!]! @@ -8695,6 +8413,9 @@ enum InstantDistributionUpdatedEvent_orderBy { pool__totalAmountInstantlyDistributedUntilUpdatedAt pool__totalAmountFlowedDistributedUntilUpdatedAt pool__totalAmountDistributedUntilUpdatedAt + pool__totalFlowAdjustmentAmountDistributedUntilUpdatedAt + pool__perUnitSettledValue + pool__perUnitFlowRate pool__totalMembers pool__totalConnectedMembers pool__totalDisconnectedMembers @@ -8729,7 +8450,8 @@ type JailEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `app` """ addresses: [Bytes!]! @@ -9103,6 +8825,9 @@ enum MemberUnitsUpdatedEvent_orderBy { pool__totalAmountInstantlyDistributedUntilUpdatedAt pool__totalAmountFlowedDistributedUntilUpdatedAt pool__totalAmountDistributedUntilUpdatedAt + pool__totalFlowAdjustmentAmountDistributedUntilUpdatedAt + pool__perUnitSettledValue + pool__perUnitFlowRate pool__totalMembers pool__totalConnectedMembers pool__totalDisconnectedMembers @@ -9120,6 +8845,8 @@ enum MemberUnitsUpdatedEvent_orderBy { poolMember__totalAmountClaimed poolMember__poolTotalAmountDistributedUntilUpdatedAt poolMember__totalAmountReceivedUntilUpdatedAt + poolMember__syncedPerUnitSettledValue + poolMember__syncedPerUnitFlowRate } type MetadataUpdateEvent implements Event { @@ -9692,6 +9419,9 @@ type Pool { totalAmountInstantlyDistributedUntilUpdatedAt: BigInt! totalAmountFlowedDistributedUntilUpdatedAt: BigInt! totalAmountDistributedUntilUpdatedAt: BigInt! + totalFlowAdjustmentAmountDistributedUntilUpdatedAt: BigInt! + perUnitSettledValue: BigInt! + perUnitFlowRate: BigInt! """ A member is any account which has more than 0 units in the pool. @@ -9815,6 +9545,30 @@ input Pool_filter { totalAmountDistributedUntilUpdatedAt_lte: BigInt totalAmountDistributedUntilUpdatedAt_in: [BigInt!] totalAmountDistributedUntilUpdatedAt_not_in: [BigInt!] + totalFlowAdjustmentAmountDistributedUntilUpdatedAt: BigInt + totalFlowAdjustmentAmountDistributedUntilUpdatedAt_not: BigInt + totalFlowAdjustmentAmountDistributedUntilUpdatedAt_gt: BigInt + totalFlowAdjustmentAmountDistributedUntilUpdatedAt_lt: BigInt + totalFlowAdjustmentAmountDistributedUntilUpdatedAt_gte: BigInt + totalFlowAdjustmentAmountDistributedUntilUpdatedAt_lte: BigInt + totalFlowAdjustmentAmountDistributedUntilUpdatedAt_in: [BigInt!] + totalFlowAdjustmentAmountDistributedUntilUpdatedAt_not_in: [BigInt!] + perUnitSettledValue: BigInt + perUnitSettledValue_not: BigInt + perUnitSettledValue_gt: BigInt + perUnitSettledValue_lt: BigInt + perUnitSettledValue_gte: BigInt + perUnitSettledValue_lte: BigInt + perUnitSettledValue_in: [BigInt!] + perUnitSettledValue_not_in: [BigInt!] + perUnitFlowRate: BigInt + perUnitFlowRate_not: BigInt + perUnitFlowRate_gt: BigInt + perUnitFlowRate_lt: BigInt + perUnitFlowRate_gte: BigInt + perUnitFlowRate_lte: BigInt + perUnitFlowRate_in: [BigInt!] + perUnitFlowRate_not_in: [BigInt!] totalMembers: Int totalMembers_not: Int totalMembers_gt: Int @@ -9933,6 +9687,9 @@ enum Pool_orderBy { totalAmountInstantlyDistributedUntilUpdatedAt totalAmountFlowedDistributedUntilUpdatedAt totalAmountDistributedUntilUpdatedAt + totalFlowAdjustmentAmountDistributedUntilUpdatedAt + perUnitSettledValue + perUnitFlowRate totalMembers totalConnectedMembers totalDisconnectedMembers @@ -10198,6 +9955,9 @@ enum PoolConnectionUpdatedEvent_orderBy { pool__totalAmountInstantlyDistributedUntilUpdatedAt pool__totalAmountFlowedDistributedUntilUpdatedAt pool__totalAmountDistributedUntilUpdatedAt + pool__totalFlowAdjustmentAmountDistributedUntilUpdatedAt + pool__perUnitSettledValue + pool__perUnitFlowRate pool__totalMembers pool__totalConnectedMembers pool__totalDisconnectedMembers @@ -10215,6 +9975,8 @@ enum PoolConnectionUpdatedEvent_orderBy { poolMember__totalAmountClaimed poolMember__poolTotalAmountDistributedUntilUpdatedAt poolMember__totalAmountReceivedUntilUpdatedAt + poolMember__syncedPerUnitSettledValue + poolMember__syncedPerUnitFlowRate } type PoolCreatedEvent implements Event { @@ -10420,6 +10182,9 @@ enum PoolCreatedEvent_orderBy { pool__totalAmountInstantlyDistributedUntilUpdatedAt pool__totalAmountFlowedDistributedUntilUpdatedAt pool__totalAmountDistributedUntilUpdatedAt + pool__totalFlowAdjustmentAmountDistributedUntilUpdatedAt + pool__perUnitSettledValue + pool__perUnitFlowRate pool__totalMembers pool__totalConnectedMembers pool__totalDisconnectedMembers @@ -10613,6 +10378,9 @@ enum PoolDistributor_orderBy { pool__totalAmountInstantlyDistributedUntilUpdatedAt pool__totalAmountFlowedDistributedUntilUpdatedAt pool__totalAmountDistributedUntilUpdatedAt + pool__totalFlowAdjustmentAmountDistributedUntilUpdatedAt + pool__perUnitSettledValue + pool__perUnitFlowRate pool__totalMembers pool__totalConnectedMembers pool__totalDisconnectedMembers @@ -10639,6 +10407,8 @@ type PoolMember { totalAmountClaimed: BigInt! poolTotalAmountDistributedUntilUpdatedAt: BigInt! totalAmountReceivedUntilUpdatedAt: BigInt! + syncedPerUnitSettledValue: BigInt! + syncedPerUnitFlowRate: BigInt! account: Account! pool: Pool! poolConnectionUpdatedEvents(skip: Int = 0, first: Int = 100, orderBy: PoolConnectionUpdatedEvent_orderBy, orderDirection: OrderDirection, where: PoolConnectionUpdatedEvent_filter): [PoolConnectionUpdatedEvent!]! @@ -10723,6 +10493,22 @@ input PoolMember_filter { totalAmountReceivedUntilUpdatedAt_lte: BigInt totalAmountReceivedUntilUpdatedAt_in: [BigInt!] totalAmountReceivedUntilUpdatedAt_not_in: [BigInt!] + syncedPerUnitSettledValue: BigInt + syncedPerUnitSettledValue_not: BigInt + syncedPerUnitSettledValue_gt: BigInt + syncedPerUnitSettledValue_lt: BigInt + syncedPerUnitSettledValue_gte: BigInt + syncedPerUnitSettledValue_lte: BigInt + syncedPerUnitSettledValue_in: [BigInt!] + syncedPerUnitSettledValue_not_in: [BigInt!] + syncedPerUnitFlowRate: BigInt + syncedPerUnitFlowRate_not: BigInt + syncedPerUnitFlowRate_gt: BigInt + syncedPerUnitFlowRate_lt: BigInt + syncedPerUnitFlowRate_gte: BigInt + syncedPerUnitFlowRate_lte: BigInt + syncedPerUnitFlowRate_in: [BigInt!] + syncedPerUnitFlowRate_not_in: [BigInt!] account: String account_not: String account_gt: String @@ -10786,6 +10572,8 @@ enum PoolMember_orderBy { totalAmountClaimed poolTotalAmountDistributedUntilUpdatedAt totalAmountReceivedUntilUpdatedAt + syncedPerUnitSettledValue + syncedPerUnitFlowRate account account__id account__createdAtTimestamp @@ -10805,6 +10593,9 @@ enum PoolMember_orderBy { pool__totalAmountInstantlyDistributedUntilUpdatedAt pool__totalAmountFlowedDistributedUntilUpdatedAt pool__totalAmountDistributedUntilUpdatedAt + pool__totalFlowAdjustmentAmountDistributedUntilUpdatedAt + pool__perUnitSettledValue + pool__perUnitFlowRate pool__totalMembers pool__totalConnectedMembers pool__totalDisconnectedMembers @@ -10831,7 +10622,10 @@ type PPPConfigurationChangedEvent implements Event { governanceAddress: Bytes! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `governanceAddress` + addresses[1] = `host` + addresses[2] = `superToken` """ addresses: [Bytes!]! @@ -14010,7 +13804,11 @@ type RewardAddressChangedEvent implements Event { governanceAddress: Bytes! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `governanceAddress` + addresses[1] = `host` + addresses[2] = `superToken` + addresses[3] = `rewardAddress` """ addresses: [Bytes!]! @@ -14194,7 +13992,9 @@ type RoleAdminChangedEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `previousAdminRole` + addresses[1] = `newAdminRole` """ addresses: [Bytes!]! @@ -14361,7 +14161,9 @@ type RoleGrantedEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `account` + addresses[1] = `sender` """ addresses: [Bytes!]! @@ -14528,7 +14330,9 @@ type RoleRevokedEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `account` + addresses[1] = `sender` """ addresses: [Bytes!]! @@ -15115,6 +14919,12 @@ type SFMeta { """ branch: String! + + """ + The subgraph package.json semver version of the current deployment. + + """ + packageVersion: String! } input SFMeta_filter { @@ -15182,6 +14992,26 @@ input SFMeta_filter { branch_ends_with_nocase: String branch_not_ends_with: String branch_not_ends_with_nocase: String + packageVersion: String + packageVersion_not: String + packageVersion_gt: String + packageVersion_lt: String + packageVersion_gte: String + packageVersion_lte: String + packageVersion_in: [String!] + packageVersion_not_in: [String!] + packageVersion_contains: String + packageVersion_contains_nocase: String + packageVersion_not_contains: String + packageVersion_not_contains_nocase: String + packageVersion_starts_with: String + packageVersion_starts_with_nocase: String + packageVersion_not_starts_with: String + packageVersion_not_starts_with_nocase: String + packageVersion_ends_with: String + packageVersion_ends_with_nocase: String + packageVersion_not_ends_with: String + packageVersion_not_ends_with_nocase: String """Filter for the block changed event.""" _change_block: BlockChangedFilter @@ -15195,6 +15025,7 @@ enum SFMeta_orderBy { blockNumber configuration branch + packageVersion } """ @@ -19847,7 +19678,8 @@ type SuperTokenFactoryUpdatedEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `newFactory` """ addresses: [Bytes!]! @@ -19990,7 +19822,8 @@ type SuperTokenLogicCreatedEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `tokenLogic` """ addresses: [Bytes!]! @@ -20133,7 +19966,9 @@ type SuperTokenLogicUpdatedEvent implements Event { name: String! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `token` + addresses[1] = `code` """ addresses: [Bytes!]! @@ -20294,7 +20129,10 @@ type SuperTokenMinimumDepositChangedEvent implements Event { governanceAddress: Bytes! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `governanceAddress` + addresses[1] = `host` + addresses[2] = `superToken` """ addresses: [Bytes!]! @@ -21210,12 +21048,6 @@ type TokenStatistic { """ totalCFAAmountStreamedUntilUpdatedAt: BigInt! - """ - The all-time total amount streamed (outflows) until the `updatedAtTimestamp`/`updatedAtBlock` for the GDA. - - """ - totalGDAAmountStreamedUntilUpdatedAt: BigInt! - """ The all-time total amount transferred until the `updatedAtTimestamp`/`updatedAtBlock`. @@ -21450,14 +21282,6 @@ input TokenStatistic_filter { totalCFAAmountStreamedUntilUpdatedAt_lte: BigInt totalCFAAmountStreamedUntilUpdatedAt_in: [BigInt!] totalCFAAmountStreamedUntilUpdatedAt_not_in: [BigInt!] - totalGDAAmountStreamedUntilUpdatedAt: BigInt - totalGDAAmountStreamedUntilUpdatedAt_not: BigInt - totalGDAAmountStreamedUntilUpdatedAt_gt: BigInt - totalGDAAmountStreamedUntilUpdatedAt_lt: BigInt - totalGDAAmountStreamedUntilUpdatedAt_gte: BigInt - totalGDAAmountStreamedUntilUpdatedAt_lte: BigInt - totalGDAAmountStreamedUntilUpdatedAt_in: [BigInt!] - totalGDAAmountStreamedUntilUpdatedAt_not_in: [BigInt!] totalAmountTransferredUntilUpdatedAt: BigInt totalAmountTransferredUntilUpdatedAt_not: BigInt totalAmountTransferredUntilUpdatedAt_gt: BigInt @@ -21553,7 +21377,6 @@ enum TokenStatistic_orderBy { totalGDAOutflowRate totalAmountStreamedUntilUpdatedAt totalCFAAmountStreamedUntilUpdatedAt - totalGDAAmountStreamedUntilUpdatedAt totalAmountTransferredUntilUpdatedAt totalAmountDistributedUntilUpdatedAt totalSupply @@ -21718,12 +21541,6 @@ type TokenStatisticLog { """ totalCFAAmountStreamed: BigInt! - """ - The all-time total amount of `token` streamed (outflows) until the `timestamp`/`block` for the GDA. - - """ - totalGDAAmountStreamed: BigInt! - """ The all-time total amount of `token` transferred until the `timestamp`/`block`. @@ -22004,14 +21821,6 @@ input TokenStatisticLog_filter { totalCFAAmountStreamed_lte: BigInt totalCFAAmountStreamed_in: [BigInt!] totalCFAAmountStreamed_not_in: [BigInt!] - totalGDAAmountStreamed: BigInt - totalGDAAmountStreamed_not: BigInt - totalGDAAmountStreamed_gt: BigInt - totalGDAAmountStreamed_lt: BigInt - totalGDAAmountStreamed_gte: BigInt - totalGDAAmountStreamed_lte: BigInt - totalGDAAmountStreamed_in: [BigInt!] - totalGDAAmountStreamed_not_in: [BigInt!] totalAmountTransferred: BigInt totalAmountTransferred_not: BigInt totalAmountTransferred_gt: BigInt @@ -22131,7 +21940,6 @@ enum TokenStatisticLog_orderBy { totalGDAOutflowRate totalAmountStreamed totalCFAAmountStreamed - totalGDAAmountStreamed totalAmountTransferred totalAmountDistributed totalSupply @@ -22174,7 +21982,6 @@ enum TokenStatisticLog_orderBy { tokenStatistic__totalGDAOutflowRate tokenStatistic__totalAmountStreamedUntilUpdatedAt tokenStatistic__totalCFAAmountStreamedUntilUpdatedAt - tokenStatistic__totalGDAAmountStreamedUntilUpdatedAt tokenStatistic__totalAmountTransferredUntilUpdatedAt tokenStatistic__totalAmountDistributedUntilUpdatedAt tokenStatistic__totalSupply @@ -22611,7 +22418,11 @@ type TrustedForwarderChangedEvent implements Event { governanceAddress: Bytes! """ - Empty addresses array. + Contains the addresses that were impacted by this event: + addresses[0] = `governanceAddress` + addresses[1] = `host` + addresses[2] = `superToken` + addresses[3] = `forwarder` """ addresses: [Bytes!]! diff --git a/packages/sdk-core/src/subgraph/subgraphQueryHandler.ts b/packages/sdk-core/src/subgraph/subgraphQueryHandler.ts index 34a201198b..452b264cb1 100644 --- a/packages/sdk-core/src/subgraph/subgraphQueryHandler.ts +++ b/packages/sdk-core/src/subgraph/subgraphQueryHandler.ts @@ -224,7 +224,7 @@ export abstract class SubgraphQueryHandler< const response = await this.querySubgraph(subgraphClient, { where: { - id: query.id.toLowerCase(), + id: query.id, }, skip: 0, take: 1, diff --git a/packages/sdk-redux/CHANGELOG.md b/packages/sdk-redux/CHANGELOG.md index 6ef753e3fb..0a6f797b78 100644 --- a/packages/sdk-redux/CHANGELOG.md +++ b/packages/sdk-redux/CHANGELOG.md @@ -5,7 +5,11 @@ All notable changes to the SDK-redux will be documented in this file. ### Changed -- Node dependency updates. +- Node dependency updates +- Reduce transaction tracking expiration from 10 minutes to 3 minutes + +### Added +- Support for `Pool`, `PoolMember` and `PoolDistributor` queries ## [0.5.1] - 2023-05-17 diff --git a/packages/sdk-redux/src/reduxSlices/rtkQuery/subgraphApiSlice/endpoints/entityArgs.ts b/packages/sdk-redux/src/reduxSlices/rtkQuery/subgraphApiSlice/endpoints/entityArgs.ts index 3aeddb1ce3..b351e97114 100644 --- a/packages/sdk-redux/src/reduxSlices/rtkQuery/subgraphApiSlice/endpoints/entityArgs.ts +++ b/packages/sdk-redux/src/reduxSlices/rtkQuery/subgraphApiSlice/endpoints/entityArgs.ts @@ -5,6 +5,9 @@ import { FlowOperatorListQuery, IndexListQuery, IndexSubscriptionsListQuery, + PoolDistributorsListQuery, + PoolListQuery, + PoolMembersListQuery, StreamListQuery, StreamPeriodListQuery, SubgraphGetQuery, @@ -100,3 +103,27 @@ export interface FlowOperatorQuery extends SubgraphGetQuery { export interface FlowOperatorsQuery extends FlowOperatorListQuery { chainId: number; } + +export interface PoolQuery extends SubgraphGetQuery { + chainId: number; +} + +export interface PoolsQuery extends PoolListQuery { + chainId: number; +} + +export interface PoolMemberQuery extends SubgraphGetQuery { + chainId: number; +} + +export interface PoolMembersQuery extends PoolMembersListQuery { + chainId: number; +} + +export interface PoolDistributorQuery extends SubgraphGetQuery { + chainId: number; +} + +export interface PoolDistributorsQuery extends PoolDistributorsListQuery { + chainId: number; +} diff --git a/packages/sdk-redux/src/reduxSlices/rtkQuery/subgraphApiSlice/endpoints/entityEndpoints.ts b/packages/sdk-redux/src/reduxSlices/rtkQuery/subgraphApiSlice/endpoints/entityEndpoints.ts index d5785d2452..666a254e84 100644 --- a/packages/sdk-redux/src/reduxSlices/rtkQuery/subgraphApiSlice/endpoints/entityEndpoints.ts +++ b/packages/sdk-redux/src/reduxSlices/rtkQuery/subgraphApiSlice/endpoints/entityEndpoints.ts @@ -13,6 +13,12 @@ import { IndexSubscription, IndexSubscriptionQueryHandler, PagedResult, + Pool, + PoolDistributor, + PoolDistributorQueryHandler, + PoolMember, + PoolMemberQueryHandler, + PoolQueryHandler, RelevantAddressProviderFromFilter, RelevantAddressProviderFromResult, Stream, @@ -50,6 +56,12 @@ import { IndexQuery, IndexSubscriptionQuery, IndexSubscriptionsQuery, + PoolDistributorQuery, + PoolDistributorsQuery, + PoolMemberQuery, + PoolMembersQuery, + PoolQuery, + PoolsQuery, StreamPeriodQuery, StreamPeriodsQuery, StreamQuery, @@ -88,6 +100,12 @@ export const createEntityEndpoints = (builder: SubgraphEndpointBuilder) => { tokenStatisticLogs: list(builder, new TokenStatisticLogQueryHandler()), flowOperator: get(builder, new FlowOperatorQueryHandler()), flowOperators: list(builder, new FlowOperatorQueryHandler()), + pool: get(builder, new PoolQueryHandler()), + pools: list(builder, new PoolQueryHandler()), + poolMember: get(builder, new PoolMemberQueryHandler()), + poolMembers: list(builder, new PoolMemberQueryHandler()), + poolDistributor: get(builder, new PoolDistributorQueryHandler()), + poolDistributors: list(builder, new PoolDistributorQueryHandler()), }; }; diff --git a/packages/sdk-redux/src/reduxSlices/transactionTrackerSlice/thunks/trackPendingTransactionThunk.ts b/packages/sdk-redux/src/reduxSlices/transactionTrackerSlice/thunks/trackPendingTransactionThunk.ts index e931659aac..e30d8b4c2a 100644 --- a/packages/sdk-redux/src/reduxSlices/transactionTrackerSlice/thunks/trackPendingTransactionThunk.ts +++ b/packages/sdk-redux/src/reduxSlices/transactionTrackerSlice/thunks/trackPendingTransactionThunk.ts @@ -40,7 +40,7 @@ export const trackPendingTransactionThunk = createAsyncThunk< const framework = await getFramework(chainId); const waitForOneConfirmation = wait ? () => wait(1) - : () => framework.settings.provider.waitForTransaction(transactionHash, 1, MillisecondTimes.TenMinutes); + : () => framework.settings.provider.waitForTransaction(transactionHash, 1, MillisecondTimes.ThreeMinutes); await waitForOneConfirmation() .then(async (transactionReceipt: ethers.providers.TransactionReceipt) => { diff --git a/packages/sdk-redux/src/reduxSlices/transactionTrackerSlice/trySerializeTransaction.ts b/packages/sdk-redux/src/reduxSlices/transactionTrackerSlice/trySerializeTransaction.ts index 283e736a50..a4d9905d80 100644 --- a/packages/sdk-redux/src/reduxSlices/transactionTrackerSlice/trySerializeTransaction.ts +++ b/packages/sdk-redux/src/reduxSlices/transactionTrackerSlice/trySerializeTransaction.ts @@ -1,17 +1,34 @@ import {SignatureLike} from '@ethersproject/bytes'; -import {ethers, UnsignedTransaction} from 'ethers'; +import {ethers, Transaction} from 'ethers'; /** * The use-case arose from Gnosis Safe transaction serialization failing. */ export const trySerializeTransaction = ( - transaction: UnsignedTransaction, + transaction: Partial, signature?: SignatureLike ): string | undefined => { try { return ethers.utils.serializeTransaction(transaction, signature); } catch (error) { // This tends to happen with Gnosis Safe which changes the transaction response structure. + + if (transaction.hash) { + // Check if the transaction hash contains a prefix (e.g. chainId) followed by colon + const parts = transaction.hash.split(':'); + if (parts.length === 2) { + // Remove the prefix and set the plain transaction hash + transaction.hash = parts[1]; + // Second attempt to serialize the transaction with the correct (?) hash + try { + return ethers.utils.serializeTransaction(transaction, signature); + } catch { + // Log the first error instead + console.warn(error); + } + } + } + console.warn(error); } return undefined; diff --git a/packages/subgraph/.gitignore b/packages/subgraph/.gitignore index ece682f377..1cd9202169 100644 --- a/packages/subgraph/.gitignore +++ b/packages/subgraph/.gitignore @@ -9,4 +9,6 @@ src/addresses.ts **/*.wasm **/*.latest.json tests/.bin -hosted-service-networks.json \ No newline at end of file +hosted-service-networks.json +config/*.json +!config/mock.json \ No newline at end of file diff --git a/packages/subgraph/src/mappings/superfluidPool.ts b/packages/subgraph/src/mappings/superfluidPool.ts index 850818c242..f4740745c2 100644 --- a/packages/subgraph/src/mappings/superfluidPool.ts +++ b/packages/subgraph/src/mappings/superfluidPool.ts @@ -30,10 +30,10 @@ export function handleDistributionClaimed(event: DistributionClaimed): void { // settle pool and pool member pool = updatePoolTotalAmountFlowedAndDistributed(event, pool); settlePDPoolMemberMU(pool, poolMember, event.block); - + // Update PoolMember poolMember.totalAmountClaimed = event.params.totalClaimed; - + pool.save(); poolMember.save(); @@ -85,7 +85,7 @@ export function handleMemberUnitsUpdated(event: MemberUnitsUpdated): void { } // 0 units to > 0 units - const didPoolMemberBecomeActive = previousUnits.equals(BIG_INT_ZERO) && event.params.newUnits.gt(BIG_INT_ZERO) + const didPoolMemberBecomeActive = previousUnits.equals(BIG_INT_ZERO) && event.params.newUnits.gt(BIG_INT_ZERO); if (didPoolMemberBecomeActive) { pool.totalMembers = pool.totalMembers + 1; // if the member is connected with units now, we add one to connected @@ -111,7 +111,7 @@ export function handleMemberUnitsUpdated(event: MemberUnitsUpdated): void { } // > 0 units to 0 units - const didPoolMemberBecomeInactive = previousUnits.gt(BIG_INT_ZERO) && poolMember.units.equals(BIG_INT_ZERO) + const didPoolMemberBecomeInactive = previousUnits.gt(BIG_INT_ZERO) && poolMember.units.equals(BIG_INT_ZERO); if (didPoolMemberBecomeInactive) { pool.totalMembers = pool.totalMembers - 1; // if the member is connected with no units now, we subtract one from connected diff --git a/packages/subgraph/tests/bugs/2024-02-29-aleph-total-supply.test.ts b/packages/subgraph/tests/bugs/2024-02-29-aleph-total-supply.test.ts index 2862a3c879..8bace6e860 100644 --- a/packages/subgraph/tests/bugs/2024-02-29-aleph-total-supply.test.ts +++ b/packages/subgraph/tests/bugs/2024-02-29-aleph-total-supply.test.ts @@ -32,7 +32,7 @@ describe("ALEPH Total Supply Bug", () => { mockedTokenSymbol(superToken, "tokenSymbol"); mockedTokenDecimals(superToken, 18); mockedResolverGet(resolverAddress, "supertokens.v1.tokenSymbol", ZERO_ADDRESS.toHexString()); - + // unused mocked function call after change in this commit (removing total supply RPC call in getOrInitSuperToken) mockedTokenTotalSupply(superToken, totalSupply);