Repository navigation
feat(transfer): add structured progress callbacks to transfer() - #49
Closed
sparkysolutions10-pixel wants to merge 1 commit into
Closed
sparkysolutions10-pixel wants to merge 1 commit into
sparkysolutions10-pixel wants to merge 1 commit into
Conversation
- Define TransferProgressStage and TransferProgressEvent discriminated union in src/types.ts - Add onProgress option to TransferOptionsBase and CompleteMintOptions - Export TransferProgressEvent and stage variants from src/index.ts - Emit progress events at existing transfer stage boundaries - Ensure onProgress exceptions are swallowed without altering transfer outcome - Add tests in tests/progress.test.ts and tests/types.test.ts - Resolves Parabola-org#6 Signed-off-by: sparkysolutions10-pixelmy <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #6
Bounty Claim: /claim #6
This PR adds structured, stage-level progress callbacks to
transfer()viaoptions.onProgress?: (event: TransferProgressEvent) => void.Changes Made
src/types.ts):TransferProgressStage = "recipient-check" | "approve" | "burn-submitted" | "burn-confirmed" | "attestation" | "mint-submitted" | "mint-confirmed".TransferProgressEventdiscriminated union with stage-specific payloads:recipient-check:stage,timestampapprove:stage,timestampburn-submitted:stage,burnTxHash,timestampburn-confirmed:stage,burnTxHash,timestampattestation:stage,burnTxHash,attestationHash?,timestampmint-submitted:stage,burnTxHash,attestationHash?,mintTxHash?,timestampmint-confirmed:stage,burnTxHash,attestationHash,mintTxHash,timestamponProgresscallback toTransferOptionsBaseandCompleteMintOptions.src/index.ts):TransferProgressStage,TransferProgressEvent, and individual event interfaces.src/transfer.ts):safeEmit): Any exceptions thrown inside caller'sonProgresscallback are swallowed to ensure observer errors never abort or alter the cross-chain transfer.onProgressis omitted.tests/progress.test.ts&tests/types.test.ts):burnTxHashpresent fromburn-submittedonward.destinationSigneremits up toattestation.onProgressthrows on every callback.Verification
pnpm typecheckpassed cleanly (tsc --noEmit).pnpm testpassed 10/10 test files (120/120 tests).pnpm build(tsup) built ESM, CJS, and DTS bundles cleanly.Signed-off-by: sparkysolutions10-pixelmy [email protected]
🪙 Base USDC / EVM Wallet:
0x40B7d9273092822341860F5610168861351e71eb🔗 Direct Razorpay: https://razorpay.me/@sparkydigitalservices