Skip to content

Commit

Permalink
Add missing index mapping to index events (#1316)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparkallas authored Mar 14, 2023
1 parent 2cdf4e0 commit 5df52af
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
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

0 comments on commit 5df52af

Please sign in to comment.