cbpay-js icon indicating copy to clipboard operation
cbpay-js copied to clipboard

Add sessionToken parameter support to initOnRamp

Open tomaszbakula opened this issue 1 year ago • 4 comments

Description & motivation

I propose extending the initOnRamp function by introducing support for a sessionToken parameter. This would allow users to initialize the function using either sessionToken or appId.

To ensure this update is fully integrated, I’ve updated the TypeScript types to include sessionToken as a valid parameter, maintaining type safety throughout the codebase. Additionally, I’ve written new test cases to confirm that the sessionToken functionality works as expected and that there are no regressions with the current implementation.

This change would enhance the current functionality without disrupting the existing workflow for those using appId.

Also, the generateOnRampURL() should be able to generate a URL based on the sessionToken only. If sessionToken has been specified, there is no need to provide the addresses parameter. Currently, it does work, and it's been fixed in this MR.

Do you think this kind of update would fit with the project’s goals and be something worth including?

Testing & documentation

I've covered adding the sessionToken parameter with the unit test.

tomaszbakula avatar Sep 17 '24 21:09 tomaszbakula

@steveviselli-cb, is there any chance you could have a look into this, please? Thanks.

tomaszbakula avatar Sep 19 '24 12:09 tomaszbakula

Hey @tomaszbakula, we're actually migrating this repo over to OnchainKit, the first release went out today! https://github.com/coinbase/onchainkit/releases/tag/v0.33.3

It's not at 100% feature parity yet, but we are focusing our efforts there. It does support passing sessionToken. The docs haven't been updated yet, but will be very soon.

steveviselli-cb avatar Oct 01 '24 20:10 steveviselli-cb

@steveviselli-cb Thank you for the detailed response! Does this mean that you will no longer be accepting any changes to this repository, or is there still room for contributions until OnchainKit reaches full feature parity?

tomaszbakula avatar Oct 02 '24 12:10 tomaszbakula

@tomaszbakula yeah sorry, we won't be accepting any more changes to this repo. We will officially end of life it soon and move everything to OnchainKit.

steveviselli-cb avatar Oct 02 '24 14:10 steveviselli-cb