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

feat(wallet): add wallet service API #1548

Merged
merged 10 commits into from
Oct 16, 2024

Conversation

Ja7ad
Copy link
Contributor

@Ja7ad Ja7ad commented Oct 13, 2024

Description

  • Get Total Stake - Get the total stake of the wallet
  • Get Address Info - Get the address info for the given address
  • Set Label - Set label for the given address
  • Get Wallet Info - Return the information about wallet
  • List Wallets - Return the list of wallets inside wallet directory
  • List Address - Return the list of addresses in wallet, it accepts

Related issue(s)

@Ja7ad
Copy link
Contributor Author

Ja7ad commented Oct 13, 2024

@b00f Can you write more details what is response of:

  • Get Wallet Info
  • List Wallets
  • List Address

@b00f
Copy link
Collaborator

b00f commented Oct 14, 2024

Get Wallet Info

Information about wallet, like Wallet name, version, Is Encrypted, Creation time, etc

List Wallets

For listing wallets, we can list files inside the wallets directory. The better solution is to keep the list of wallets in wallets.json.

List Address

The list of all addresses in a wallet.

@Ja7ad Ja7ad marked this pull request as ready for review October 16, 2024 05:59
util/io_test.go Outdated Show resolved Hide resolved
util/io_test.go Outdated Show resolved Hide resolved
wallet/manager.go Outdated Show resolved Hide resolved
wallet/manager.go Outdated Show resolved Hide resolved
func (wm *Manager) ListAddress(walletName string) ([]vault.AddressInfo, error) {
wlt, ok := wm.wallets[walletName]
if !ok {
return nil, status.Errorf(codes.NotFound, "wallet is not loaded")
Copy link
Collaborator

Choose a reason for hiding this comment

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

One potential refactor is to define proper error types here.

Copy link
Contributor Author

@Ja7ad Ja7ad Oct 16, 2024

Choose a reason for hiding this comment

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

@b00f Can you explain more about your suggestion?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should define error types here.

wallet/manager.go Outdated Show resolved Hide resolved
wallet/wallet.go Outdated Show resolved Hide resolved
@b00f b00f merged commit 9a40408 into pactus-project:main Oct 16, 2024
10 checks passed
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.

GetAddressHistory is missed from Swagger API Wallet Service APIs
2 participants