import { Avalanche } from "../../dist" import { PlatformVMAPI, KeyChain } from "../../dist/apis/platformvm" import { GetStakeResponse } from "../../dist/apis/platformvm/interfaces" import { PrivateKeyPrefix, DefaultLocalGenesisPrivateKey } from "../../dist/utils" const ip: string = "marularpc.savannah.network" const port: number = 9650 const protocol: string = "http" const networkID: number = 7 const avalanche: Avalanche = new Avalanche(ip, port, protocol, networkID) const pchain: PlatformVMAPI = avalanche.PChain() const pKeychain: KeyChain = pchain.keyChain() const privKey: string = `${PrivateKeyPrefix}${DefaultLocalGenesisPrivateKey}` pKeychain.importKey(privKey) const pAddressStrings: string[] = pchain.keyChain().getAddressStrings() const encoding: string = "hex" const main = async (): Promise => { const getStakeResponse: GetStakeResponse = await pchain.getStake( pAddressStrings, encoding ) console.log(getStakeResponse) } main()