Skip to content

Commit

Permalink
Added optional account index to cosmjs, removed values from CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
codebycarson committed Jan 8, 2024
1 parent 83da2c7 commit c882bbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 0 additions & 6 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Changelog

## 0.0.0-internal-20240104081628

### Patch Changes

- pre-release test

## 3.1.2

### Patch Changes
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/lib/metamask-snap/cosmjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ export const requestSignature = async (
export class CosmJSOfflineSigner implements OfflineDirectSigner {
readonly chainId: string;
readonly snapId: string;
readonly accountIndex: number;

constructor(chainId: string, snapId: string) {
constructor(chainId: string, snapId: string, accountIndex?: number) {
this.chainId = chainId;
this.snapId = snapId;
this.accountIndex = accountIndex || 0;
}

async getAccounts(): Promise<AccountData[]> {
const wallet = await getWallet(0, this.snapId);
const wallet = await getWallet(this.accountIndex, this.snapId);
return wallet.getAccounts();
}

Expand Down

0 comments on commit c882bbb

Please sign in to comment.