Get All Vendor Equipments

Retrieving All Equipment for a Vendor

The getAllVendorEquipments method retrieves all equipment associated with a specific vendor. It takes a single parameter:

  • vendorPubkey: UmiPublicKey of the vendor

Example usage

import { PartPayClient } from '@partpay-libs/sdk';
import { Keypair } from '@solana/web3.js';

// The Solana RPC endpoint for communicating with the mainnet/devnet network.
const endpoint = const endpoint = 'https://api.devnet.solana.com'; 
// The secret (private) key for signing transactions.
const secretKey = Keypair.generate().secretKey; 
// Initializes a PartPayClient using the specified Solana RPC endpoint and secret key for authentication.
const client = PartPayClient.createWithUmi(endpoint, secretKey); 

const vendorPublicKey = Keypair.generate().publicKey;

try {
const equipments = await client.getAllVendorEquipments(vendorPublicKey);
console.log('Vendor equipments:', equipments);

This method returns an array of EquipmentPublicKey objects, each representing a piece of equipment associated with the vendor.