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

refactor: simplified wallet setup #52

Merged
merged 9 commits into from
Feb 27, 2024

Conversation

sarvalabs-harshrastogi
Copy link
Member

@sarvalabs-harshrastogi sarvalabs-harshrastogi commented Feb 22, 2024

Simplified Wallet Setup and Initialization

This pull request introduces significant enhancements to the js-moi-wallet module, simplifying the wallet setup and initialization APIs for a more user-friendly experience.

Changes

The following key changes have been implemented:

  • constructor: Now, a Wallet instance is created using the private key, serving as both the creation and initialization step.

  • Wallet.fromMnemonic: Enables the creation of a wallet using a mnemonic and a specified path.

  • Wallet.fromMnemonicSync: Synchronously creates a wallet using a mnemonic and a path.

  • Wallet.fromKeystore: Allows the creation of a wallet instance using a provided keystore and password.

  • Wallet.createRandom: Introduces a method to create a wallet instance using a randomly generated mnemonic.

  • Wallet.createRandomSync: Provides a synchronous alternative for creating a wallet instance with a randomly generated mnemonic.

These changes collectively simplify the wallet setup process and contribute to a more intuitive and streamlined API structure.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have tested this code
  • I have updated the README and other relevant documents (guides...)

@sarvalabs-harshrastogi sarvalabs-harshrastogi added enhancement New feature or request wallet Issues related to wallet breaking labels Feb 22, 2024
@sarvalabs-harshrastogi sarvalabs-harshrastogi changed the base branch from main to develop February 22, 2024 15:56
__tests__/e2e/interactions.test.ts Outdated Show resolved Hide resolved
docs/source/hierarchical-deterministic-wallet.rst Outdated Show resolved Hide resolved
docs/source/hierarchical-deterministic-wallet.rst Outdated Show resolved Hide resolved
docs/source/logic.rst Outdated Show resolved Hide resolved
packages/js-moi-logic/__tests__/logic.test.ts Outdated Show resolved Hide resolved
packages/js-moi-wallet/README.md Outdated Show resolved Hide resolved
packages/js-moi-wallet/dist/wallet.d.ts Outdated Show resolved Hide resolved
packages/js-moi-wallet/dist/wallet.d.ts Show resolved Hide resolved
Copy link

cloudflare-workers-and-pages bot commented Feb 27, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6580b6c
Status: ✅  Deploy successful!
Preview URL: https://3f7b620d.js-moi-sdk.pages.dev
Branch Preview URL: https://refactor-wallet-initializati.js-moi-sdk.pages.dev

View logs

@sarvalabs-gokul sarvalabs-gokul merged commit 0e3822b into develop Feb 27, 2024
2 checks passed
@sarvalabs-harshrastogi sarvalabs-harshrastogi deleted the refactor/wallet-initialization branch March 4, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking enhancement New feature or request wallet Issues related to wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplified Wallet Setup with the New API
2 participants