@venti-team/lemon-nfts-sdk
TypeScript icon, indicating that this package has built-in type declarations

3.0.8 • Public • Published

Lemon's NFTs SDK 🍋

Build Status

A package to handle Lemon NFTs Services.


📥 Installation

// TODO: add information about installing private packages

npm install @lemonatio/lemon-nfts-sdk

🛠️ Configuration

You will need Lemon backoffice api key to use consume Lemon services.


📃 Usage

import { CollectionsServices, DigitalIdentityService, PaymentLinkService } from ('@lemonatio/lemon-nfts-sdk');

const config = {
    environment: 'PRE', 
    apiKey: 'super-private-api-key' 
};

// To get a collection
const collection = await CollectionsServices.getById('1AB4', config); // Returns null if no collection was found

if(!collection) return;

// To asign a nft to a user 
await DigitalIdentityService.asignNftToUser('1AB4', 'some-lemon-tag', config);

// To create a payment lint
const { id: paymentLinkId } = await PaymentLinkService.create({
    orderId: `${orderId}`,
    description: 'El show de gretulis tickets',
    amount: 100,
    currency: 'ARS',
    notificationUrl: `https://gretulis.net/notification/`,
    redirectionUrl: {
        success:  'https://gretulis.net/resultado-operacion?code=200&',
        failure:  'https://gretulis.net/resultado-operacion?code=200&',
        pending:  'https://gretulis.net/eventos'
    },
    expiresAt: '2023-07-07T15:41:19.868Z',
}, config);

// To get payment link
const paymentLink = await PaymentLinkService.getPaymentLink(paymentLinkId, config); // Returns null if no collection was found

⚠️ Errors

TODO

The codes are the following:

Code Code Number Error Message
INTERNAL_SERVER_ERROR 0 Internal Error System performing the request
GETTING_COLLECTION_ERROR 1 Error when getting the collection
INVALID_LEMON_TAG 2 The lemon tag provided is invalid or it does not exists
INVALID_COLLECTION_ID 3 The collection id provided is invalid
ASIGNING_NFT_TO_USER 4 Error asigning nft to user
CREATING_PAYMENT_LINK 5 Error creating payment link
INVALID_PAYMENT_LINK 6 Invalid payment link data
GETTING_PAYMENT_LINK 7 Error getting payment link

📜 Extra Documentation

  • NFTs
    • 📄 TODO
  • Lemon
    • 📦 TODO
  • Venti implementation
    • 📄 TODO

Readme

Keywords

Package Sidebar

Install

npm i @venti-team/lemon-nfts-sdk

Weekly Downloads

80

Version

3.0.8

License

ISC

Unpacked Size

51.6 kB

Total Files

57

Last publish

Collaborators

  • rodrivaldivia