Skip to content

Refactored fcl-core wallet-utils folder files to TypeScript #2478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 17, 2025

Conversation

mfbz
Copy link
Contributor

@mfbz mfbz commented May 29, 2025

Close #2452

@mfbz mfbz requested a review from a team as a code owner May 29, 2025 08:31
Copy link

changeset-bot bot commented May 29, 2025

⚠️ No Changeset found

Latest commit: b0cdbd5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

}).toThrow(Error)
})

test("encode account proof with missing appIdentifier", () => {
expect.assertions(1)
expect(() => {
encodeAccountProof({address, nonce})
encodeAccountProof({address, nonce} as any)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not AccountProofData with appIdentifier omitted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated and set AccountProofData with optional properties

@mfbz mfbz requested a review from chasefleming June 5, 2025 13:35
export const ready = (cb, msg = {}) => {
export const ready = (
cb: (data: any, context: {origin: string}) => void,
msg: PollingResponse = {} as PollingResponse
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg: PollingResponse = {} as PollingResponse

Looks like msg is unused here. IMO we should maybe just take this opportunity to drop it. The risk is that users could get type errors for this if they were passing an (unused) msg arg here, but functionally this should not break anything so I think it's worth it for the long term.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to me it makes completely sense because it's useless. If we want to maintain backward compatibility we could still leave it but make it optional like it is done in the sendMsgToFCL method. What do you think?

mfbz and others added 3 commits June 13, 2025 15:26
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
mfbz and others added 6 commits June 13, 2025 15:32
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
mfbz and others added 5 commits June 13, 2025 15:37
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
Co-authored-by: Jordan Ribbink <17958158+jribbink@users.noreply.github.com>
@mfbz mfbz requested a review from jribbink June 16, 2025 13:52
sendMsgToFCL("FCL:VIEW:RESPONSE", {
f_type: "PollingResponse",
f_vsn: "1.0.0",
status: "DECLINED",
reason: reason,
data: null,
})
} as PollingResponse)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these type assertions necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore, removed!

@mfbz mfbz merged commit 23ec6a8 into feature/typescript-fcl-core Jun 17, 2025
@mfbz mfbz deleted the mfbz/refactor-fcl-core-wallet-utils branch June 17, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants