@venti-team/lemon-nfts-sdk
v3.0.8
Published
SDK to call Lemon NFTs services.
Downloads
178
Readme
Lemon's NFTs SDK :lemon:
A package to handle Lemon NFTs Services.
:inbox_tray: Installation
// TODO: add information about installing private packages
npm install @lemonatio/lemon-nfts-sdk
:hammer_and_wrench: Configuration
You will need Lemon backoffice api key
to use consume Lemon services.
:page_with_curl: 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
:warning: 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 |
:scroll: Extra Documentation
- NFTs
- :page_facing_up: TODO
- Lemon
- :package: TODO
- Venti implementation
- :page_facing_up: TODO