From 0b4eb575422816859ccae9950d95648e6a83eb9d Mon Sep 17 00:00:00 2001 From: bferenc <117105626+bferenc@users.noreply.github.com> Date: Thu, 21 Nov 2024 00:50:24 +0100 Subject: [PATCH] feat: add getsubnet api endpoint (#920) --- src/vms/pvm/api.ts | 6 ++++++ src/vms/pvm/models.ts | 15 +++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/vms/pvm/api.ts b/src/vms/pvm/api.ts index a93aa5201..2aff4cfb9 100644 --- a/src/vms/pvm/api.ts +++ b/src/vms/pvm/api.ts @@ -28,6 +28,8 @@ import type { GetStakeResponse, GetStakingAssetIDParams, GetStakingAssetIDResponse, + GetSubnetParams, + GetSubnetResponse, GetSubnetsParams, GetSubnetsResponse, GetTimestampResponse, @@ -184,6 +186,10 @@ export class PVMApi extends AvaxApi { ); } + getSubnet(getSubnetParams: GetSubnetParams): Promise { + return this.callRpc('getSubnet', getSubnetParams); + } + getSubnets(getSubnetsParams: GetSubnetsParams): Promise { return this.callRpc('getSubnets', getSubnetsParams); } diff --git a/src/vms/pvm/models.ts b/src/vms/pvm/models.ts index b7e43e832..be919bc80 100644 --- a/src/vms/pvm/models.ts +++ b/src/vms/pvm/models.ts @@ -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[]; }