Skip to content

Commit

Permalink
fix: repair chain fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Sep 8, 2022
1 parent 9f69229 commit d7758a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/account/default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StarknetChainId, ZERO } from '../constants';
import { ZERO } from '../constants';
import { ProviderInterface, ProviderOptions } from '../provider';
import { Provider } from '../provider/default';
import { Signer, SignerInterface } from '../signer';
Expand Down Expand Up @@ -32,10 +32,6 @@ export class Account extends Provider implements AccountInterface {
'getPubKey' in keyPairOrSigner ? keyPairOrSigner : new Signer(keyPairOrSigner as KeyPair);
}

public async getChainId(): Promise<StarknetChainId> {
return this.getChainId();
}

public async getNonce(): Promise<string> {
const { result } = await this.callContract({
contractAddress: this.address,
Expand Down
4 changes: 4 additions & 0 deletions src/provider/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export class Provider implements ProviderInterface {
return this.provider.chainId;
}

public async getChainId(): Promise<StarknetChainId> {
return this.provider.getChainId();
}

public async getBlock(blockIdentifier: BlockIdentifier = 'pending'): Promise<GetBlockResponse> {
return this.provider.getBlock(blockIdentifier);
}
Expand Down
2 changes: 2 additions & 0 deletions src/provider/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import { BlockIdentifier } from './utils';
export abstract class ProviderInterface {
public abstract chainId: StarknetChainId;

public abstract getChainId(): Promise<StarknetChainId>;

/**
* Calls a function on the StarkNet contract.
*
Expand Down

0 comments on commit d7758a6

Please sign in to comment.