Skip to content

Conversation

@sukantoraymond
Copy link
Collaborator

@sukantoraymond sukantoraymond commented Sep 30, 2025

Creates one Signer function for all chains that can be used by all wallet implementations.

This PR also reorganizes files to be in line with local wallet / server wallet separation

@sukantoraymond sukantoraymond changed the base branch from server-wallet-api-cli to reorganize-wallet September 30, 2025 21:46
@sukantoraymond sukantoraymond changed the base branch from reorganize-wallet to server-wallet-api-cli September 30, 2025 21:47
)

// SignTx constructs a transaction for the specified operation
func SignTx(ctx context.Context, wallet *primary.Wallet, params SignTxParams) (tx.SignTxResult, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So we can have one sign function that can be used across all chains, and have said function consumed by all implementations of wallet interface

Comment on lines +34 to +44
// BuildTxOutput represents a generic interface for transaction results
type BuildTxOutput interface {
// GetTxType returns the transaction type identifier
GetTxType() string
// GetChainType returns which chain this transaction is for
GetChainType() string
// GetTx returns the actual transaction (interface{} to support different chain types)
GetTx() interface{}
// Validate validates the result
Validate() error
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To support multi chain Build Tx result

)

// BuildTx constructs a transaction for the specified operation
func BuildTx(ctx context.Context, wallet *primary.Wallet, params BuildTxParams) (tx.BuildTxResult, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

abstracting BuildTx into builder.go so that this function can be used by local wallet and server wallet so we can reuse the same function


// BuildTx constructs a transaction for the specified operation
func (w *LocalWallet) BuildTx(ctx context.Context, params BuildTxParams) (tx.BuildTxResult, error) {
func (w *LocalWallet) BuildTx(ctx context.Context, params wallet.BuildTxParams) (tx.BuildTxResult, error) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function will now be used by all wallet implementations for signing

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.

2 participants