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

Implementing initial version of Wallet Class #13

Merged
merged 11 commits into from
May 16, 2024
Merged

Conversation

erdimaden
Copy link
Contributor

What changed? Why?

Updated ESLint rules to enforce proper JSDoc comments.

New format for JSDoc comments:

  /**
   * Description
   *
   * @param - Short description
   * @returns - Short description
   * @throws Short description
   */
  • Enforced a new line between the description and parameters.
  • All parameters used in a method are now required to be documented.

base_sepolia usage changed

  • Updated base_sepolia usage to align with the Ruby repository.
  • Replaced base_sepolia with Coinbase.networkList.BaseSepolia for consistency:
// Before
const network = base_sepolia;

// After
const network = Coinbase.networkList.BaseSepolia;

Initial Version of Wallet Class and Test Cases

  • Introduced the initial version of the Wallet class and test cases.
  • This PR lays the foundation for the createWallet functionality, which will be added in a subsequent PR to keep this PR manageable in size.

Qualified Impact

@erdimaden erdimaden force-pushed the feat/wallet-class branch from 9aa8a2b to 3e39c02 Compare May 16, 2024 04:42
@erdimaden erdimaden force-pushed the feat/wallet-class branch from 3e39c02 to 13e9211 Compare May 16, 2024 04:51
* @constant
*/
static networkList = {
BaseSepolia: "base_sepolia",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
BaseSepolia: "base_sepolia",
BaseSepolia: "base-sepolia",

it("should return the correct string representation", async () => {
const wallet = await Wallet.init(VALID_WALLET_MODEL, client);
expect(wallet.toString()).toBe(
`Wallet{id: '${VALID_WALLET_MODEL.id}', networkId: 'base_sepolia'}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`Wallet{id: '${VALID_WALLET_MODEL.id}', networkId: 'base_sepolia'}`,
`Wallet{id: '${VALID_WALLET_MODEL.id}', networkId: 'base-sepolia'}`,

Comment on lines 17 to 19
* @param {CreateWalletRequest} [createWalletRequest] - The wallet creation request.
* @param {RawAxiosRequestConfig} [options] - Axios request options.
* @throws {APIError} If the request fails.
Copy link
Contributor

Choose a reason for hiding this comment

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

no longer necessary to type the JSDOC

Comment on lines 48 to 51
* @param {string} walletId - The ID of the wallet the address belongs to.
* @param {string} addressId - The onchain address of the address that is being fetched.
* @param {AxiosRequestConfig} [options] - Axios request options.
* @throws {APIError} If the request fails.
Copy link
Contributor

Choose a reason for hiding this comment

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

types no longer necessary in JSDOC

Comment on lines 68 to 69
* @returns {AxiosPromise<UserModel>} - A promise resolvindg to the User model.
* @throws {APIError} If the request fails.
Copy link
Contributor

Choose a reason for hiding this comment

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

types no longer necessary in JSDOC

Comment on lines 67 to 68
* @param {Uint8Array} key - The key to convert.
* @returns {string} The converted hex string.
Copy link
Contributor

Choose a reason for hiding this comment

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

no longer need typing in the JSDOC param and return

@erdimaden erdimaden merged commit b419443 into master May 16, 2024
4 checks passed
@erdimaden erdimaden deleted the feat/wallet-class branch June 21, 2024 18:04
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.

2 participants