Skip to content

Commit

Permalink
feat: add getsubnet api endpoint (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
bferenc authored Nov 20, 2024
1 parent 7fca80c commit 0b4eb57
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/vms/pvm/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import type {
GetStakeResponse,
GetStakingAssetIDParams,
GetStakingAssetIDResponse,
GetSubnetParams,
GetSubnetResponse,
GetSubnetsParams,
GetSubnetsResponse,
GetTimestampResponse,
Expand Down Expand Up @@ -184,6 +186,10 @@ export class PVMApi extends AvaxApi {
);
}

getSubnet(getSubnetParams: GetSubnetParams): Promise<GetSubnetResponse> {
return this.callRpc<GetSubnetResponse>('getSubnet', getSubnetParams);
}

getSubnets(getSubnetsParams: GetSubnetsParams): Promise<GetSubnetsResponse> {
return this.callRpc<GetSubnetsResponse>('getSubnets', getSubnetsParams);
}
Expand Down
15 changes: 15 additions & 0 deletions src/vms/pvm/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,21 @@ export interface GetStakingAssetIDResponse {
assetID: string;
}

export interface GetSubnetParams {
subnetID: string;
}

export interface GetSubnetResponse {
isPermissioned: boolean;
controlKeys: string[];
threshold: string;
locktime: string;
subnetTransformationTxID: string;
conversionID: string;
managerChainID: string;
managerAddress: string | null;
}

export interface GetSubnetsParams {
ids: string[];
}
Expand Down

0 comments on commit 0b4eb57

Please sign in to comment.