Skip to content

Commit

Permalink
map name, isnfttransfer, isnftapproval
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparkallas committed Mar 26, 2024
1 parent 8131d69 commit c43fe51
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]

### Added

- Added `getTotalAmountReceivedByMember`

### Changed
Expand All @@ -15,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- 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

Expand Down
2 changes: 2 additions & 0 deletions packages/sdk-core/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ export interface TransferEvent extends EventBase {
to: string;
value: string;
token: string;
isNFTTransfer: boolean;
}

export interface AgreementClassRegisteredEvent extends EventBase {
Expand Down Expand Up @@ -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";
Expand Down
5 changes: 2 additions & 3 deletions packages/sdk-core/src/mapGetAllEventsQueryEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ export const mapGetAllEventsQueryEvents = (
to: x.to.id,
token: x.token,
value: x.value,
isNFTTransfer: x.isNFTTransfer,
});
case "TrustedForwarderChangedEvent":
return typeGuard<events.TrustedForwarderChangedEvent>({
Expand Down Expand Up @@ -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<events.ApprovalForAllEvent>({
Expand All @@ -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<events.UnknownEvent>({
// force casted as empty string for the type system
name: eventBase.name as "",
Expand Down
Loading

0 comments on commit c43fe51

Please sign in to comment.