Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@quicknode/sdk

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@quicknode/sdk

![npm](https://img.shields.io/npm/dm/@quicknode/sdk) ![npm](https://img.shields.io/npm/v/@quicknode/sdk?color=g) ![Maintenance](https://img.shields.io/maintenance/yes/2022?color=g) ![NPM](https://img.shields.io/npm/l/@quicknode/sdk?color=g) ![GitHub issue

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
708
increased by36.15%
Maintainers
4
Weekly downloads
 
Created
Source

npm npm Maintenance NPM GitHub issues Discord

QuickNode SDK

Currently has support for getting started with Icy Tools GraphQL API in a blink!

Quick Start

import { QuickNodeSDK } from '@quicknode/sdk';

const client = new QuickNodeSDK();

client.nft
  .getNFTsByWalletENS({
    ensName: 'vitalik.eth',
    first: 5,
  })
  .then((response) => console.log(response));

Full example implementation here

Providing a config object to the client

:warning: This client (and the underlying API) can be used without an icyApiKey, but its usage will be heavily rate limited, intended for trial and development purposes only.

import { QuickNodeSDK } from '@quicknode/sdk';

const client = new QuickNodeSDK({
  icyApiKey: 'my-api-key', // which is obtained by signing up on https://developers.icy.tools/
});

Client config API

PropertyValuesExample
icyApiKeystring1c1t00ls-4p10-k3y0-lu21-43405e3310

Methods

nft.getNFTsByWalletENS

ArgumentValuesOptionalDescriptionExample
ensNamestringWallet ENS addressvitalik.eth
firstnumberNumber of results to return10
afterstringReturn results after end cursorYXJyYXljb25uZWN0aW9uOjUwNQ=
import { QuickNodeSDK } from '@quicknode/sdk';

const client = new QuickNodeSDK();

client.nft
  .getNFTsByWalletENS({
    ensName: 'vitalik.eth',
    first: 5,
  })
  .then((response) => console.log(response));

nft.getNFTsByWalletAddress

ArgumentValuesOptionalDescriptionExample
addressstringWallet address0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
firstnumberNumber of results to return10
afterstringReturn results after end cursorYXJyYXljb25uZWN0aW9uOjUwNQ=
import { QuickNodeSDK } from '@quicknode/sdk';

const client = new QuickNodeSDK();

client.nft
  .getNFTsByWalletAddress({
    address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
    first: 5,
  })
  .then((response) => console.log(response));

nft.getNFTsByContractAddress

ArgumentValuesOptionalDescriptionExample
addressstringContract address of NFT0x2106C00Ac7dA0A3430aE667879139E832307AeAa
firstnumberNumber of results to return10
afterstringReturn results after end cursorYXJyYXljb25uZWN0aW9uOjUwNQ=
import { QuickNodeSDK } from '@quicknode/sdk';

const client = new QuickNodeSDK();

client.nft
  .getNFTsByContractAddress({
    address: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
    first: 5,
  })
  .then((response) => console.log(response));

nft.getCollectionDetails

ArgumentValuesOptionalDescriptionExample
addressstringContract address of NFT0x2106C00Ac7dA0A3430aE667879139E832307AeAa
import { QuickNodeSDK } from '@quicknode/sdk';

const client = new QuickNodeSDK();

client.nft
  .getCollectionDetails({
    address: '0x2106C00Ac7dA0A3430aE667879139E832307AeAa',
  })
  .then((response) => console.log(response));

nft.getNFTEventLogs

ArgumentValuesOptionalDescriptionExample
addressstringContract address of NFT0x2106C00Ac7dA0A3430aE667879139E832307AeAa
tokenIdstringNFT ID100
typesarrayAn array of event types 'TRANSFER', 'ORDER', and/or 'MINT'. Defaults to all types['TRANSFER', 'ORDER', 'MINT]
firstnumberNumber of results to return10
afterstringReturn results after end cursorYXJyYXljb25uZWN0aW9uOjUwNQ=
import { QuickNodeSDK } from '@quicknode/sdk';

const client = new QuickNodeSDK();

client.nft
  .getNFTEventLogs({
    address: '0x60E4d786628Fea6478F785A6d7e704777c86a7c6',
    tokenId: '100',
    types: ['TRANSFER', 'ORDER'],
  })
  .then((response) => console.log(response));

nft.getNFTDetails

Returns the details for a single NFT

ArgumentValuesOptionalDescriptionExample
contractAddressstringContract address of NFT Collection0x2106C00Ac7dA0A3430aE667879139E832307AeAa
tokenIdstringNFT ID5020
import { QuickNodeSDK } from '@quicknode/sdk';

const client = new QuickNodeSDK();

client.nft
  .getNFTDetails({
    contractAddress: '0x23581767a106ae21c074b2276D25e5C3e136a68b',
    tokenId: '400',
  })
  .then((response) => console.log(response));

nft.getContractEventLogs

Returns the log events for a NFT contract

ArgumentValuesOptionalDescriptionExample
addressstringContract address of NFT0x2106C00Ac7dA0A3430aE667879139E832307AeAa
typesarrayAn array of event types 'TRANSFER', 'ORDER', and/or 'MINT'. Defaults to all types['TRANSFER', 'ORDER', 'MINT]
firstnumberNumber of results to return10
afterstringReturn results after end cursorYXJyYXljb25uZWN0aW9uOjUwNQ=
import { QuickNodeSDK } from '@quicknode/sdk';

const client = new QuickNodeSDK();

client.nft
  .getContractEventLogs({
    address: '0x60E4d786628Fea6478F785A6d7e704777c86a7c6',
    tokenId: '100',
    types: ['TRANSFER', 'ORDER'],
  })
  .then((response) => console.log(response));

Pagination

For functions that support pagination, use the first property to specify the amount of results to return.

The returned data.tokensPageInfo.endCursor property in the response can be used to access subsequent results. This value can be passed in to the after property and will return the results after that endCursor.

hasNextPage can be used to determine the end of the results, where it will be false.

For example, if a response contains:

"data": {
  "tokensPageInfo": {
    "hasNextPage": true,
    "endCursor": 'YXJyYXljb25uZWN0aW9uOlk='
  }
}

calling the following will get the next page of results

client.nft.getNFTsByWalletENS({
  ensName: 'vitalik.eth',
  first: 5,
  after: 'YXJyYXljb25uZWN0aW9uOlk=', // from data.tokensPageInfo.endCursor in response
});

Contributing corner

Building

Run nx build libs-api-sdk to build the library.

Running unit tests

Run nx test libs-api-sdk to execute the unit tests via Jest.

Running lint

Run nx lint libs-api-sdk to execute the lint via ESLint.

FAQs

Package last updated on 25 Oct 2022

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