Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/chains/src/decorators/AVMChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
AVMNodeCollection,
AVMTransactionParamsResponse,
Transports,
ChainConstructor,
} from '@/types';

export default class AVMChain extends AbstractChain {
Expand Down Expand Up @@ -50,7 +51,9 @@ export default class AVMChain extends AbstractChain {
* public static methods
*/

public static async initialize<T extends typeof AVMChain>(this: T): Promise<AVMChain> {
public static async initialize(
this: ChainConstructor<CAIP002Namespace.Algorand | CAIP002Namespace.AVM>
): Promise<AVMChain> {
const algod = this._defaultNode(this.transports.algods);
const baseURL = `${algod.origin}${algod.port ? `:${algod.port}` : ''}`;
const config: AxiosRequestConfig | undefined = algod.token
Expand Down
4 changes: 2 additions & 2 deletions packages/chains/src/decorators/EVMChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CAIP002Namespace } from '@/enums';
import AbstractChain from './AbstractChain';

// types
import type { ChainParameters, RPCPayload, RPCResponse, RPCURLs, Transports } from '@/types';
import type { ChainConstructor, ChainParameters, RPCPayload, RPCResponse, RPCURLs, Transports } from '@/types';

export default class EVMChain extends AbstractChain {
/**
Expand Down Expand Up @@ -43,7 +43,7 @@ export default class EVMChain extends AbstractChain {
* public static methods
*/

public static async initialize<T extends typeof EVMChain>(this: T): Promise<EVMChain> {
public static async initialize(this: ChainConstructor<CAIP002Namespace.EIP155>): Promise<EVMChain> {
const rpcURL = this._defaultRPCURL(this.transports.https);
const id = uuid();
const { data } = await axios.post<RPCResponse<string>, AxiosResponse<RPCResponse<string>, RPCPayload>, RPCPayload>(
Expand Down