New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@poap-xyz/attributes

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@poap-xyz/attributes

Registry module for the poap.js library

  • 0.0.11
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
4
Weekly downloads
 
Created
Source

POAP Attributes

Package to interact with POAP Attributes

Installation

NPM

npm install @poap-xyz/attributes @poap-xyz/utils @poap-xyz/providers axios form-data

Yarn

yarn add @poap-xyz/attributes @poap-xyz/utils @poap-xyz/providers axios form-data

Usage

import { AttributesClient, FetchAttributesInput } from '@poap-xyz/attributes';
import { RegistryApiProvider, CompassProvider } from '@poap-xyz/providers';

const registryApiProvider = new RegistryApiProvider();
const compassProvider = new CompassProvider();
const attributesClient = new AttributesClient(registryApiProvider, compassProvider);

// Create a single attribute
const attribute = await attributesClient.create({
  // Input data for creating the attribute
});

// Create multiple attributes
const attributes = await attributesClient.createBulk({
  // Input data for creating the attributes
});

// Fetch a paginated list of attributes filtered by key and value, and sorted by order
const input: FetchAttributesInput = {
  limit: 10,
  offset: 0,
  order: 'asc',
  key: 'someKey',
  value: 'someValue',
};

const result = await attributesClient.fetch(input);

API

AttributesClient

A client for creating and fetching attributes.

AttributesClient(RegistryApiProvider, CompassProvider)

Creates a new AttributesClient instance.

Parameters
  • RegistryApiProvider (required): The registry API provider to use for creating attributes.
  • CompassProvider (required): The Compass provider to use for fetching attributes.
create(input)

Creates a single attribute.

Parameters
  • input (required): The input data for creating the attribute.
Returns

A Promise that resolves with the created attribute.

createBulk(input)

Creates multiple attributes.

Parameters
  • input (required): The input data for creating the attributes.
Returns

A Promise that resolves with an array of the created attributes.

fetch(input)

Fetches a paginated list of attributes filtered by key and value, and sorted by order.

Parameters
  • input (required): An object containing the input parameters.
    • limit (required): The maximum number of attributes to retrieve per page.
    • offset (required): The offset to start retrieving attributes from.
    • order (required): The attribute order to use. Can be "asc" or "desc".
    • key (optional): The key to filter the attributes by.
    • value (optional): The value to filter the attributes by.
Returns

A promise that resolves to a paginated result of attributes.

Attribute

A class representing an attribute.

Attribute({id, dropId, key, value, timestamp, tokenId})

Creates a new Attribute instance.

Parameters
  • id (required): The attribute ID.
  • dropId (optional): The drop ID associated with the attribute.
  • key (required): The attribute key.
  • value (required): The attribute value.
  • timestamp (required): The timestamp of the attribute.
  • tokenId (optional): The token ID associated with the attribute.

Documentation

For more detailed documentation, please visit this link.

Examples

For example scripts and usage, please check the examples.

Contributing

We welcome contributions! Please see the CONTRIBUTING.md file for guidelines.

License

@poap-xyz/attributes is released under the MIT License.

FAQs

Package last updated on 03 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc