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

[PSDK-86] Enable creation of wallets backed by server signers #48

Merged
merged 3 commits into from
May 20, 2024

Conversation

alex-stone
Copy link
Contributor

What changed? Why?

This enables developers to create wallets that are backed by server signers v.s. managing the seeds themselves.

When calling user.create_wallet(server_signer: true) the wallet will be created and associated with the project's default server signer (if one exists). It will return an error if a server signer does not exist for that project.

Default address creation

Rather than add further cases to the wallet initialization this removes the side-effects from that method in favor of a Wallet.create class method.

This code path will only be used for creation of wallets, where we will additionally create a default address for wallets that are not backed by server signers.

Network IDs

This also adds support for specifying the network_id which the backend will properly validate based on supported networks.

Qualified Impact

This touches the user.create_wallet flow

create_wallet_request: {
wallet: {
network_id: network_id,
use_server_signer: server_signer
Copy link
Contributor

Choose a reason for hiding this comment

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

could you add this to the readme as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Synced offline, we will update the readme once external developers are able to create and run server signers on their own.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 to keeping it semi-hidden for now :)

@@ -20,21 +20,11 @@ def id
end

# Creates a new Wallet belonging to the User.
# @param network_id [String] (Optional) the ID of the blockchain network. Defaults to 'base-sepolia'.
# @param server_signer [Boolean] (Optional) whether Wallet should use project's server signer. Defaults to false.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we document saying this is a no-op right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moving to a feature branch!

@alex-stone alex-stone changed the base branch from v0.0.5 to feature/server-signers May 17, 2024 21:50
@alex-stone
Copy link
Contributor Author

@jazz-cb @yuga-cb

Changes

  • Moved to a feature branch
  • We'll land this to the next candidate version once we support server signer wallet seed creation + address generation from the SDK

This bumps the openapi ruby client to the latest openapi spec
that allows for creating wallets with a server signer.
This enables creating a wallet with a server signer, e.g.
`Coinbase::Wallet.create(server_signer: true)`

This will create a new wallet using your projects default server
signer.
@alex-stone alex-stone force-pushed the stone/PSDK-86-server-signer branch from 6e9377a to 1ce540b Compare May 20, 2024 16:28
@alex-stone alex-stone merged commit a465bed into feature/server-signers May 20, 2024
9 checks passed
@alex-stone alex-stone deleted the stone/PSDK-86-server-signer branch May 20, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants