onbloc / adena-wallet-sdk

(WIP) Provides an SDK to connect Gno blockchain-based applications with Adena Wallet.
MIT License
1 stars 1 forks source link

Proposal: Refactor Wallet SDK Structure for Enhanced Flexibility and Maintainability #4

Open jinoosss opened 2 weeks ago

jinoosss commented 2 weeks ago

Description

Current Structure

wallet-sdk
└── src
    ├── methods                # Function methods (direct window object access)
    │   ├── connect.ts
    │   ├── disconnect.ts
    │   ├── getBalance.ts
    │   └── broadcastTransaction.ts
    ├── utils                  # Utility functions
    ├── types                  # Common type definitions
    └── ...

Proposed Changes

wallet-sdk/
└── src/
    ├── providers
    │   ├── wallet             # In addition to Wallet, it manages other providers
    │   │   ├── errors
    │   │   ├── adena-wallet-provider
    │   │   └── tm2-wallet-provider
    │   └── ...                # Other providers
    ├── utils 
    ├── types                  # Common type definitions
    ├── config
    ├── core
    │   ├── sdk
    │   └── ...
    └── ...

Expected Outcomes

dongwon8247 commented 2 weeks ago

@RezaRahemtola @clockworkgr What do you guys think?

RezaRahemtola commented 2 weeks ago

Looks interesting !

Agree on the provider abstraction to build an SDK that is wallet provider agnostic.

For this part:

Support for RPC Providers: Extend functionality to allow the SDK to work with RPC providers alongside wallet providers.

Isn't gno-js-client already supporting RPC providers and more officially linked to Gno ?

Introducing state management hooks for popular web framework would really simplify the usage. In my mind we should hopefully end up with library/ies similar to viem and wagmi on Ethereum in term of devx