@poap-xyz/moments v0.3.0
@poap-xyz/moments
@poap-xyz/moments is a package to interact with POAP Moments.
Features
- Create a Moment attached to a Drop or an specific POAP
- Fetch multiple Moments
- Fetch a single Moment
Installation
NPM
npm install @poap-xyz/moments @poap-xyz/utils @poap-xyz/providers axios
Yarn
yarn add @poap-xyz/moments @poap-xyz/utils @poap-xyz/providers axio
Usage
import { MomentsClient, CreateMomentInput, Moment } from '@poap-xyz/moments';
import { PoapCompass, PoapMomentsApi, AuthenticationProviderHttp } from '@poap-xyz/providers';
import fs from 'fs';
// Set up the PoapMomentsApi with proper authentication
const momentsApi = new PoapMomentsApi({
authenticationProvider: new AuthenticationProviderHttp(
'CLIENT_ID',
'CLIENT_SECRET',
),
});
const client = new MomentsClient(
momentsApi,
new PoapCompass('your_api_key_for_compass'),
);
const input: CreateMomentInput = {
dropId: 110148,
tokenId: 6568008, // Optional: The Token ID related to the moment
medias: [{
fileBinary: await fs.promises.readFile('src/assets/poap.png'),
fileType: 'image/png',
}],
author: '0x82AB2941Cf555CED5ad7Ed232a5B5f6083815FBC',
description: 'Your moment description here', // Optional description for the moment
onStepUpdate: (step) => {
console.log(step); // Monitor the step-by-step process of creating a moment
},
onFileUploadProgress: (progress) => {
console.log(progress); // Monitor file upload progress
},
timeOut: 5000, // Optional: Set a timeout for the media processing
};
const moment: Moment = await client.createMoment(input);
Explanations for each step:
Step Name | Explanation |
---|---|
UPLOADING_MEDIA | The process of uploading media assets. |
PROCESSING_MEDIA | The media assets are being processed after upload. |
PROCESSING_MEDIA_ERROR | An error occurred during the media processing phase. |
UPLOADING_MOMENT | The process of uploading the moment's data. |
FINISHED | The entire operation of creating the moment is complete. |
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/moments is released under the MIT License.
4 days ago
3 days ago
3 days ago
3 days ago
3 days ago
3 days ago
7 days ago
7 days ago
8 days ago
7 days ago
8 days ago
14 days ago
14 days ago
17 days ago
17 days ago
25 days ago
27 days ago
28 days ago
29 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
4 months ago
11 months ago
10 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
10 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
12 months ago
12 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago