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: add a wallet restore endpoint with mnemonic #43

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

verbotenj
Copy link
Contributor

@verbotenj verbotenj commented Nov 26, 2023

Closes #34

}

// Restore the wallet using the mnemonic
wallet, err := bursa.RestoreWallet(request.Mnemonic)
Copy link
Member

Choose a reason for hiding this comment

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

Use bursa.NewDefaultWallet, like above. The results are exactly the same and you don't need the RestoreWallet function, at all.

wallet, err := bursa.RestoreWallet(request.Mnemonic)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Internal server error"})
return
Copy link
Member

Choose a reason for hiding this comment

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

Increment our failure metric before returning

}

// Return the wallet details
c.JSON(http.StatusOK, wallet)
Copy link
Member

Choose a reason for hiding this comment

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

Define a success metric and increment it here before returning.

@verbotenj verbotenj merged commit d638c3a into main Nov 27, 2023
7 checks passed
@verbotenj verbotenj deleted the feat-create-restore-endpoint branch November 27, 2023 00:29
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.

Create a wallet restore endpoint
2 participants