-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
team/filecoin-pin"Filecoin Pin" project is a stakeholder for this work."Filecoin Pin" project is a stakeholder for this work.team/fs-wgFOC working group is a stakeholder for this work, and thus wants to track it on their project board.FOC working group is a stakeholder for this work, and thus wants to track it on their project board.
Milestone
Description
filecoin-pin/src/core/synapse/index.ts
Lines 185 to 189 in 300ecd5
| progressCallbacks?: { | |
| onProviderSelected?: (provider: any) => void | |
| onDataSetCreationStarted?: (transaction: any) => void | |
| onDataSetResolved?: (info: { dataSetId: number; isExisting: boolean }) => void | |
| } |
Instead of surfacing the granularity of callbacks that exist in synapse-sdk, we should allow consumers to pass an onProgress handler that receives an event for any of the callbacks. Similar to what we have in checkUploadReadiness:
/**
* Options for evaluating whether an upload can proceed.
*/
export type UploadReadinessProgressEvent =
| { type: 'checking-balances' }
| { type: 'checking-allowances' }
| { type: 'configuring-allowances' }
| { type: 'allowances-configured'; transactionHash?: string }
| { type: 'validating-capacity' }
export interface UploadReadinessOptions {
/** Initialized Synapse instance. */
synapse: Synapse
/** Size of the CAR file (bytes). */
fileSize: number
/**
* Automatically configure allowances when they are missing.
* Defaults to `true` to match current CLI/action behaviour.
*/
autoConfigureAllowances?: boolean
/** Optional callback for progress updates. */
onProgress?: (event: UploadReadinessProgressEvent) => void
}what do you think @rvagg ?
Metadata
Metadata
Assignees
Labels
team/filecoin-pin"Filecoin Pin" project is a stakeholder for this work."Filecoin Pin" project is a stakeholder for this work.team/fs-wgFOC working group is a stakeholder for this work, and thus wants to track it on their project board.FOC working group is a stakeholder for this work, and thus wants to track it on their project board.