Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK-core] Add missing distribution index Subgraph ID mapping to the index events #1316

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Add support for `activeOutgoingStreamCount`, `activeIncomingStreamCount`, `inactiveOutgoingStreamCount`, `inactiveIncomingStreamCount` properties in query for `AccountTokenSnapshot` entity
- Add support for `rewardAddress`, `liquidationPeriod`, `patricianPeriod`, and `minimumDeposit` properties in query for `Token` entity
- Add support for `userData` property in query for `Stream` entity
- Add `index` (the Subgraph entity ID) field to Index events when querying from Subgraph

### Changed
- `.exec` or `.execForward` will throw an error if the operations array is empty
Expand Down
6 changes: 6 additions & 0 deletions packages/sdk-core/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface IndexCreatedEvent extends EventBase {
name: "IndexCreated";
token: string;
publisher: string;
index: string;
indexId: string;
userData: string;
}
Expand All @@ -101,6 +102,7 @@ export interface IndexDistributionClaimedEvent extends EventBase {
name: "IndexDistributionClaimed";
token: string;
publisher: string;
index: string;
indexId: string;
subscriber: string;
amount: string;
Expand All @@ -110,6 +112,7 @@ export interface IndexSubscribedEvent extends EventBase {
name: "IndexSubscribed";
token: string;
publisher: string;
index: string;
indexId: string;
subscriber: string;
}
Expand All @@ -118,6 +121,7 @@ export interface IndexUnitsUpdatedEvent extends EventBase {
name: "IndexUnitsUpdated";
token: string;
publisher: string;
index: string;
indexId: string;
subscriber: string;
units: string;
Expand All @@ -129,6 +133,7 @@ export interface IndexUnsubscribedEvent extends EventBase {
name: "IndexUnsubscribed";
token: string;
publisher: string;
index: string;
indexId: string;
subscriber: string;
userData: string;
Expand All @@ -138,6 +143,7 @@ export interface IndexUpdatedEvent extends EventBase {
name: "IndexUpdated";
token: string;
publisher: string;
index: string;
indexId: string;
oldIndexValue: string;
newIndexValue: string;
Expand Down
6 changes: 6 additions & 0 deletions packages/sdk-core/src/mapGetAllEventsQueryEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export const mapGetAllEventsQueryEvents = (
timestamp: Number(x.timestamp),
logIndex: Number(x.logIndex),
token: x.token,
index: x.index.id,
indexId: x.indexId,
publisher: x.publisher,
userData: x.userData,
Expand All @@ -224,6 +225,7 @@ export const mapGetAllEventsQueryEvents = (
logIndex: Number(x.logIndex),
token: x.token,
amount: x.amount,
index: x.index.id,
indexId: x.indexId,
publisher: x.publisher,
subscriber: x.subscriber,
Expand All @@ -239,6 +241,7 @@ export const mapGetAllEventsQueryEvents = (
timestamp: Number(x.timestamp),
logIndex: Number(x.logIndex),
token: x.token,
index: x.index.id,
indexId: x.indexId,
publisher: x.publisher,
subscriber: x.subscriber,
Expand All @@ -254,6 +257,7 @@ export const mapGetAllEventsQueryEvents = (
timestamp: Number(x.timestamp),
logIndex: Number(x.logIndex),
token: x.token,
index: x.index.id,
indexId: x.indexId,
publisher: x.publisher,
subscriber: x.subscriber,
Expand All @@ -272,6 +276,7 @@ export const mapGetAllEventsQueryEvents = (
timestamp: Number(x.timestamp),
logIndex: Number(x.logIndex),
token: x.token,
index: x.index.id,
indexId: x.indexId,
publisher: x.publisher,
subscriber: x.subscriber,
Expand All @@ -288,6 +293,7 @@ export const mapGetAllEventsQueryEvents = (
timestamp: Number(x.timestamp),
logIndex: Number(x.logIndex),
token: x.token,
index: x.index.id,
indexId: x.indexId,
newIndexValue: x.newIndexValue,
oldIndexValue: x.oldIndexValue,
Expand Down