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: create wallet namespace #1051

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export * from './utils/calldata/enum';
export * from './utils/contract';
export * from './utils/events';
export * from './utils/transactionReceipt';
export * as wallet from './wallet/wallet';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know there was a discussion about this on Discord, but if we have a better idea not to have wallet/wallet ? I know naming is the hardest thing in development and I'm nitpicking xD
cc @tabaktoni

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you prefer a file called walletAPI.ts ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

One possibility is to use export * as wallet from './wallet' in src/wallet/index.ts in place of export * from './connect' instead of removing it (could even keep the connect file name).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I went back to connect.ts, keeping export * as wallet.


/**
* Deprecated
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
signMessage,
switchStarknetChain,
watchAsset,
} from './connect';
} from './wallet';
import { StarknetWalletProvider } from './types';

// Represent 'Selected Active' Account inside Connected Wallet
Expand Down
1 change: 0 additions & 1 deletion src/wallet/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './account';
export * from './connect';
File renamed without changes.