Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Latest commit

 

History

History
39 lines (28 loc) · 1.34 KB

File metadata and controls

39 lines (28 loc) · 1.34 KB
description
Query CFA Data

Money Streaming Events

CFA Events (For Money Streaming)

flowUpdated: emits any time there is a creation, update, or deletion event of a stream. Note that “type” will represent the type of update:

0 = creation event

1 = update event

2 = deletion event

Solidity Event:

Sample Subgraph Query:

#returns the new netFlowRate along with all flowUpdated events for a user
query MyQuery {
  flowUpdatedEvents(where: {sender: "0xdcb45e4f6762c3d7c61a00e96fb94adb7cf27721"}) {
    timestamp
    token
		type
    totalSenderFlowRate
		totalAmountStreamedUntilTimestamp
		stream {
	      streamedUntilUpdatedAt
	    }
  }
}

Note that totalAmountStreamedUntil timestamp is useful because it will return the total amount streamed until the state change, and streamedUntilUpdatedAt will return the total amount stream since the previous state change. Learn more about this here.