# @alembic/marketplace-sdk

> The Alembic SDK is a comprehensive, stable, and powerful Javascript SDK designed to help developers build innovative applications and platforms leveraging the power of NFTs and marketplace. With support for ERC721 and ERC1155 tokens, our SDK provides acce

Latest version **0.1.8** (published 2023-05-24) · UNLICENSED license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @alembic/marketplace-sdk
pnpm add @alembic/marketplace-sdk
yarn add @alembic/marketplace-sdk
bun add @alembic/marketplace-sdk
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2023-05-24 |
| First published | 2023-05-24 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 44.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Cometh.io |
| Maintainers | fred-alembic, yoanslvy, shoto290, rvkoon-cometh |

## Links

- npm: https://www.npmjs.com/package/@alembic/marketplace-sdk
- Repository: https://github.com/cometh-game/alembic-marketplace-sdk
- Homepage: https://github.com/cometh-game/alembic-marketplace-sdk#readme
- Issues: https://github.com/cometh-game/alembic-marketplace-sdk/issues
- npm.io page: https://npm.io/package/@alembic/marketplace-sdk

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.3.4

## Recent versions

- 0.1.8 (latest) — 2023-05-24
- 0.1.7 — 2023-05-24
- 0.1.6 — 2023-05-24
- 0.1.5 — 2023-05-24
- 0.1.4 — 2023-05-24
- 0.1.3 — 2023-05-24
- 0.1.2 — 2023-05-24
- 0.1.1 — 2023-05-24
- 0.1.0 — 2023-05-24

## README

# Alembic Marketplace SDK

The Alembic SDK is a comprehensive, stable, and powerful Javascript SDK designed to help developers build innovative applications and platforms leveraging the power of NFTs and marketplace. With support for ERC721 and ERC1155 tokens, our SDK provides access to essential metadata and core features of the marketplace, ensuring a seamless experience for developers.

Key SDK components include:

- **Assets**: Access metadata for both ERC721 and ERC1155 tokens, including token ID, owner, and other relevant details.
- **Collections**: Retrieve information about NFT collections and individual tokens within a collection, including token addresses, assets, and metadata.
- **Activity**: Fetch crucial marketplace events such as token transfers, token listings, token purchases.
- **Listings**: Manage and interact with token listings, enabling users to create, update, and view listings for both buying and selling tokens.
- **Offers**: Handle and track offers sent and received by users, providing a robust system to negotiate deals and facilitate transactions...

## Install SDK

```sh
yarn add @alembic/marketplace-sdk
```

## Available methods

**Get Collection details**

```ts
import alembic from '@alembic/marketplace-sdk'
alembic.getCollectionByAddress('YOUR_CONTRACT_ADDRESS')
```

Response:

```ts
type Collection = {
  contract_address: string
  name: string
  supply: string
  owners: string
  floor_price: string
  listings: string
  offers: string
  total_volume: string
  attributes: {
    [type: string]: {
      [value: string]: number
    }
  }
}
```

**Get an asset by token id**

```ts
import alembic from '@alembic/marketplace-sdk'
alembic.getAssetById('YOUR_CONTRACT_ADDRESS', 'TOKEN_ID')
```

Response:

```ts
type Asset = {
  contract_address: string
  token_id: string
  owner: string
  metadata: AssetMetadata | null
  current_price: string | null
  best_offer: string | null
  listings: ListingOrder[] | null
  offers: AssetOffer[] | null
}
```

**Search assets with specific filters**

```ts
import alembic from '@alembic/marketplace-sdk'
alembic.searchAssetsByFilter({
  contractAddress: 'YOUR_CONTRACT_ADDRESS',
  owner: 'OWNER_ADDRESS',
  attributes: {
    Rarity: ['Gold']
  },
  orderBy: OrderByType.PRICE,
  direction: OrderByDirection.DESC,
  skip: 0,
  limit: 0
})
```

Response:

```ts
type GetAssetsResult = {
  assets: {
    contract_address: string
    token_id: string
    owner: string
    metadata: AssetMetadata | null
    current_price: string | null
    best_offer: string | null
    listings: ListingOrder[] | null
    offers: AssetOffer[] | null
  }[]
  total: number
}
```

**Refresh metadata of an asset**

```ts
import alembic from '@alembic/marketplace-sdk'
alembic.refreshAssetMetadata('YOUR_CONTRACT_ADDRESS', 'TOKEN_ID')
```

---
_Source: https://npm.io/package/@alembic/marketplace-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
