Skip to content
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

Create wallet #2

Merged
merged 4 commits into from
Sep 12, 2022
Merged

Create wallet #2

merged 4 commits into from
Sep 12, 2022

Conversation

jpuri
Copy link
Contributor

@jpuri jpuri commented Sep 7, 2022

Adding function to create wallet.

src/index.ts Outdated
tags,
}: CreateWalletRequest): Promise<CreateWalletResponse> {
return this.requestPost(
"users/create-wallet",
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't every method in the SDK need to send the clientID up to the API? so that it knows which app to associate the action with?

Copy link
Contributor Author

@jpuri jpuri Sep 8, 2022

Choose a reason for hiding this comment

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

Here, user will pass appId also for this purpose. I can add clientId also to each request, alternatively we can also use userToken to get appId.

Should I remove passing appId here and rather use clientId to get appId at backend ?

cc @mjmayank , @wchan2

Copy link
Contributor

Choose a reason for hiding this comment

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

Where does the user pass appID? Maybe I’m missing it. Does it happen automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I missed it here in SDK, I added appId field to api. But I would prefer to replace it with clientId or userToken.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah let’s do clientID since that’s how we plan to identify the app as I understand

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the PR

Copy link
Contributor

Choose a reason for hiding this comment

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

We should be able to re-use the /wallets endpoint or move it to /users/wallets to create the wallet to have to be RESTful. If we re-use the /wallets endpoint, that would mean that we need another guard, changing up how we generate the JWT. I would have put the users id in the URI as well but it doesn't make too much sense to have a user id in the URI for the client auth SDK.

Copy link
Contributor Author

@jpuri jpuri Sep 12, 2022

Choose a reason for hiding this comment

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

I updated the api to /users/wallets

Adding userId to URI does not looks useful to me.

@jpuri jpuri requested a review from mjmayank September 8, 2022 12:13
src/index.test.ts Outdated Show resolved Hide resolved
src/index.ts Outdated
tags,
}: CreateWalletRequest): Promise<CreateWalletResponse> {
return this.requestPost(
"users/create-wallet",
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be able to re-use the /wallets endpoint or move it to /users/wallets to create the wallet to have to be RESTful. If we re-use the /wallets endpoint, that would mean that we need another guard, changing up how we generate the JWT. I would have put the users id in the URI as well but it doesn't make too much sense to have a user id in the URI for the client auth SDK.

@jpuri jpuri merged commit f93e5c2 into login_using_email Sep 12, 2022
@jpuri jpuri deleted the create_wallet branch September 12, 2022 23:12
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