Skip to content

Conversation

@bluecco
Copy link
Contributor

@bluecco bluecco commented Mar 12, 2025

Issue / feature description

Update starknetjs version in order to use WalletAccount with webwallet connector without requiring

 const accounts = await this.request({
      type: "wallet_requestAccounts",
      params: { silent_mode: true },
    })

Changes

  • update starknetjs and @starknet-io/types-js
  • use WalletAccount instead of Account

Checklist

  • Rebased to the last commit of the target branch (or merged)
  • Code self-reviewed
  • Code self-tested
  • Tests updated (if needed)
  • All tests are passing locally

Please keep your pull request as small as possible. If you need to make multiple changes, please create separate pull requests for each change. Create a draft pull request if you need early feedback. This will mark the pull request as a work in progress and prevent it from being reviewed or merged until you are ready.

Please move drafts to the ready for review (regular PR) when you are ready to start the review process and other developers will pick it up from there.

@bluecco bluecco requested a review from Cussone March 12, 2025 14:42
@bluecco bluecco changed the base branch from develop to beta-wallet-account March 12, 2025 14:45
})

return new Account(provider, accounts[0], "")
return new WalletAccount(provider, this._wallet, undefined, accounts[0])
Copy link
Member

@Cussone Cussone Mar 12, 2025

Choose a reason for hiding this comment

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

I guess this is not a breaking change, just an addition to everything Account has? (Since WalletAccount extends Account, probably?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct declare class WalletAccount extends Account implements AccountInterface {

it adds the starknet window object methods

/**
     * WALLET EVENTS
     */
    onAccountChange(callback: AccountChangeEventHandler): void;
    onNetworkChanged(callback: NetworkChangeEventHandler): void;
    /**
     * WALLET SPECIFIC METHODS
     */
    requestAccounts(silentMode?: boolean): Promise<string[]>;
    getPermissions(): Promise<"accounts"[]>;
    switchStarknetChain(chainId: StarknetChainId): Promise<boolean>;
    watchAsset(asset: WatchAssetParameters): Promise<boolean>;
    addStarknetChain(chain: AddStarknetChainParameters): Promise<boolean>;

@bluecco bluecco merged commit 518a579 into beta-wallet-account Mar 12, 2025
1 check passed
@Cussone Cussone deleted the fix/starknetjs-version branch March 20, 2025 10:49
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.

3 participants