0.3.0 • Published 3 days ago

@poap-xyz/moments v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

@poap-xyz/moments

License: MIT

@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 NameExplanation
UPLOADING_MEDIAThe process of uploading media assets.
PROCESSING_MEDIAThe media assets are being processed after upload.
PROCESSING_MEDIA_ERRORAn error occurred during the media processing phase.
UPLOADING_MOMENTThe process of uploading the moment's data.
FINISHEDThe 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.

0.2.9-beta-v0

4 days ago

0.3.0

3 days ago

0.3.0-beta-v2

3 days ago

0.3.0-beta-v1

3 days ago

0.3.0-beta-v0

3 days ago

0.3.0-beta-v3

3 days ago

0.2.8-beta-v0

7 days ago

0.2.8

7 days ago

0.2.7-beta-v1

8 days ago

0.2.7

7 days ago

0.2.7-beta-v0

8 days ago

0.2.6-beta-v0

14 days ago

0.2.6

14 days ago

0.2.5-beta-v0

17 days ago

0.2.5

17 days ago

0.2.4

25 days ago

0.2.4-beta-v0

27 days ago

0.2.3

28 days ago

0.2.2

29 days ago

0.2.1-beta-v7

1 month ago

0.2.1-beta-v8

1 month ago

0.2.1-beta-v3

1 month ago

0.2.1-beta-v4

1 month ago

0.2.1-beta-v5

1 month ago

0.2.1-beta-v6

1 month ago

0.2.1-beta-v1

1 month ago

0.2.1-beta-v2

1 month ago

0.2.1

1 month ago

0.2.0

1 month ago

0.1.8

1 month ago

0.0.3-beta-v3

2 months ago

0.0.3-beta-v4

2 months ago

0.0.3-beta-v5

2 months ago

0.0.3-beta-v1

2 months ago

0.1.7-beta-v4

2 months ago

0.1.7-beta-v3

2 months ago

0.1.7

2 months ago

0.1.6

2 months ago

0.1.5-beta-v1

2 months ago

0.1.4-beta-v1

2 months ago

0.1.3-beta-v4

2 months ago

0.1.3-beta-v3

2 months ago

0.1.3-beta-v2

2 months ago

0.1.3-beta-v1

2 months ago

0.1.2

4 months ago

0.0.24

11 months ago

0.0.25

10 months ago

0.0.37-beta-v1

9 months ago

0.0.36-beta-v1

9 months ago

0.0.37

9 months ago

0.0.38

8 months ago

0.0.39

8 months ago

0.0.30

10 months ago

0.0.31

9 months ago

0.0.33

9 months ago

0.0.35

9 months ago

0.0.36

9 months ago

0.1.0

8 months ago

0.1.1-beta-v2

6 months ago

0.1.1

6 months ago

0.1.1-beta-v3

6 months ago

0.1.1-beta-v6

6 months ago

0.1.1-beta-v8

6 months ago

0.0.26

10 months ago

0.0.27

10 months ago

0.0.28

10 months ago

0.0.29

10 months ago

0.0.20

11 months ago

0.0.21

11 months ago

0.0.22

11 months ago

0.0.23

11 months ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.14

1 year ago

0.0.15

12 months ago

0.0.16

12 months ago

0.0.17

12 months ago

0.0.18

12 months ago

0.0.19

11 months ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago