Skip to content

SDP-1614: Update configuration management for embedded wallets - #704

Merged
philipliu merged 5 commits into
feature/c-accountsfrom
philip/sdp-1614-embedded-wallets-config
Jun 13, 2025
Merged

SDP-1614: Update configuration management for embedded wallets#704
philipliu merged 5 commits into
feature/c-accountsfrom
philip/sdp-1614-embedded-wallets-config

Conversation

@philipliu

@philipliu philipliu commented Jun 10, 2025

Copy link
Copy Markdown
Contributor

What

This updates the configuration management for the RPC-dependent features. It introduces the following flags:

Embedded Wallets

  • enable-embedded-wallets: Enables wallet creation and transaction sponsorship
    • requires RPC_URL and embedded-wallets-wasm-hash
  • embedded-wallets-wasm-hash: Embedded wallet contract Wasm hash

Contract Account Support

  • enable-sep45: Enables SEP-45 authentication used by known contract accounts and embedded wallets
    • requires sep45-contract-id and RPC_URL

Why

Previously, features such as SEP-45 or embedded wallets APIs were gated behind the presence of the RPC_URL flag. These features had their configurations that needed to be set, but the relationship between them and the RPC_URL was not clear.

Known limitations

N/A

Checklist

  • Title follows SDP-1234: Add new feature or Chore: Refactor package xyz format. The Jira ticket code was included if available.
  • PR has a focused scope and doesn't mix features with refactoring
  • Tests are included (if applicable)
  • CHANGELOG.md is updated (if applicable)
  • CONFIG/SECRETS changes are updated in helmcharts and deployments (if applicable)
  • Preview deployment works as expected
  • Ready for production

@philipliu
philipliu temporarily deployed to Anchor Integration Tests June 10, 2025 22:59 — with GitHub Actions Inactive
@philipliu
philipliu temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) June 10, 2025 22:59 — with GitHub Actions Inactive
@philipliu
philipliu force-pushed the philip/sdp-1614-embedded-wallets-config branch from 72c36b5 to fc44398 Compare June 10, 2025 23:19
@philipliu
philipliu temporarily deployed to Anchor Integration Tests June 10, 2025 23:19 — with GitHub Actions Inactive
@philipliu
philipliu temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) June 10, 2025 23:19 — with GitHub Actions Inactive
@stellar-jenkins

This comment was marked as duplicate.

@philipliu
philipliu force-pushed the philip/sdp-1614-embedded-wallets-config branch from fc44398 to ba3a878 Compare June 11, 2025 00:37
@philipliu
philipliu temporarily deployed to Anchor Integration Tests June 11, 2025 00:37 — with GitHub Actions Inactive
@philipliu
philipliu temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) June 11, 2025 00:37 — with GitHub Actions Inactive
@stellar-jenkins

This comment was marked as duplicate.

@philipliu
philipliu force-pushed the philip/sdp-1614-embedded-wallets-config branch from ba3a878 to a9a8e43 Compare June 11, 2025 15:33
@philipliu
philipliu temporarily deployed to Anchor Integration Tests June 11, 2025 15:33 — with GitHub Actions Inactive
@philipliu
philipliu temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) June 11, 2025 15:33 — with GitHub Actions Inactive
@philipliu
philipliu marked this pull request as ready for review June 11, 2025 15:41
@philipliu
philipliu temporarily deployed to Anchor Integration Tests June 11, 2025 21:39 — with GitHub Actions Inactive
@philipliu
philipliu temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) June 11, 2025 21:39 — with GitHub Actions Inactive

@marwen-abid marwen-abid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Great changes 🎉

Comment thread internal/serve/serve.go Outdated
Comment on lines +137 to +138
return fmt.Errorf("error creating embedded wallet service: %w", err)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("error creating embedded wallet service: %w", err)
}
return fmt.Errorf("creating embedded wallet service: %w", err)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We have several error logs starting with error in this file, so I added it for consistency; however, we should probably remove them. I can open another PR on develop.

Comment thread internal/serve/serve.go
}

// Setup Embedded Wallet Service (only if enabled)
if opts.EnableEmbeddedWallets {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

💡Maybe we should add an Info/Debug log here to say that Enable Embedded Wallets is enabled for this runtime.

Comment thread internal/serve/serve.go
// Feature specific validation
if opts.Sep45ContractId != "" && opts.RpcConfig.RPCUrl == "" {
return fmt.Errorf("RPC URL must be set when SEP-45 contract ID is set")
// RPC-dependent feature validation

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍 Nice! this looks clean.

Comment thread internal/serve/serve.go
EmbeddedWalletService: o.EmbeddedWalletService,
}
r.Post("/", walletCreationHandler.CreateWallet)
r.Get("/status", walletCreationHandler.GetWallet)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🧪 Can you add these new endpoints to Test_handleHTTP_authenticatedEndpoints in serve_test.go ?

@philipliu
philipliu temporarily deployed to Anchor Integration Tests June 13, 2025 15:24 — with GitHub Actions Inactive
@philipliu
philipliu temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) June 13, 2025 15:24 — with GitHub Actions Inactive
@philipliu
philipliu merged commit 77df230 into feature/c-accounts Jun 13, 2025
@philipliu
philipliu deleted the philip/sdp-1614-embedded-wallets-config branch June 13, 2025 15:50
@philipliu philipliu mentioned this pull request Jun 23, 2025
7 tasks
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