Skip to content

Commit

Permalink
refactor: add type for deal info reducer
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Oct 23, 2023
1 parent 57c4e05 commit fab21b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/filecoin-api/src/deal-tracker/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const dealInfo = async ({ capability }, context) => {
}

return acc
}, /** @type {Record<string, any>} */ ({})),
}, /** @type {Record<string, DealDetails>} */ ({})),
},
}
}
Expand Down
15 changes: 9 additions & 6 deletions packages/filecoin-api/src/dealer/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,24 @@ import {
ServiceConfig,
} from '../types.js'

export type OfferStore<OfferDoc> = UpdatableStore<string, OfferDoc>
export type AggregateStore = UpdatableAndQueryableStore<
AggregateRecordKey,
AggregateRecord,
Pick<AggregateRecord, 'status'>
>

export interface ServiceContext<OfferDoc = OfferDocument> {
id: Signer
/**
* Stores serialized broker specific offer document containing details of the
* aggregate and it's pieces.
*/
offerStore: UpdatableStore<string, OfferDoc>
offerStore: OfferStore<OfferDoc>
/**
* Stores aggregates and their deal proofs.
*/
aggregateStore: UpdatableAndQueryableStore<
AggregateRecordKey,
AggregateRecord,
Pick<AggregateRecord, 'status'>
>
aggregateStore: AggregateStore
}

export interface AggregateInsertEventContext
Expand Down

0 comments on commit fab21b9

Please sign in to comment.