@specify-sh/sdk
Version:
JS SDK for Specify Publishers
42 lines • 1.4 kB
TypeScript
import type { SpecifyAd, SpecifyInitConfig } from "./types";
type Address = `0x${string}`;
/**
* Specify Publisher SDK client
*
* Provides access to publisher content based on end user wallet address.
*/
export default class Specify {
private readonly publisherKey;
/**
* Creates a new Specify client instance
*
* @param config - Configuration object containing publisherKey
* @throws {AuthenticationError} When publisher key format is invalid
*/
constructor(config: SpecifyInitConfig);
/**
* Validates the publisher key format
*
* @param key - Publisher key to validate
* @returns True if the key is valid, false otherwise
*/
private validatePublisherKey;
/**
* Validates wallet address format
*
* @param address - Ethereum or EVM-compatible wallet address
* @returns True if the address is valid, false otherwise
*/
private validateAddress;
/**
* Serves content to the specified wallet address
*
* @param address - Ethereum or EVM-compatible wallet address
* @throws {ValidationError} When wallet address format is invalid
* @returns Ad content for the specified wallet address or null if the ad is not found
*/
serve(address: Address): Promise<SpecifyAd | null>;
}
export * from "./types";
export * from "./error";
//# sourceMappingURL=index.d.ts.map