npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

blink-parser

v0.0.5

Published

Blinkz Parser is a react component that allows rendering of Web3 interactable content defined by [actions specification](https://github.com/DecenterApps/actions-sdk/blob/main/packages/actions-spec/index.d.ts) directly onto any custom or existing (via the

Downloads

294

Readme

Blinkz Parser

Overview

Blinkz Parser is a react component that allows rendering of Web3 interactable content defined by actions specification directly onto any custom or existing (via the extension) Web app. This tool leverages JSON-based action definitions stored on IPFS, allowing users to interact with Web3 content within Web2 environments.

Getting started

Importing the parser into your code

To use the parser, you firstly need to install the NPM package:

npm install blink-parser

After installing the package, you can import the BlinkEntry (component that renders a blink) this way:

import { BlinkEntry } from 'blink-parser';

And it can be used like this:

<BlinkEntry url={"BLINK_URL"} initialCid={"IPFS_CID"} style='x-light'></BlinkEntry>

Where BLINK_URL is the url that blink leads to if clicked, and IPFS_CID is the IPFS cid of the Blink's JSON, as defined in the actions specification.

The example use of the parser can be found in extension/src/pages/Content/index.js.

Parser Technical Overview

Parser package provides you with the ready-to-use React component, that you can plug in to any react project. One of its use cases can be to inject the blink into twitter, as shown in the extension, but it can also be used for injecting it into other websites, as well as adding the native blink support in Web apps.

This is a brief overview of how the component actually works:

  1. In parser/src/App.tsx, we call the parseActions function (defined in parser/src/utils/parser.tsx) to differentiate Blink's list of actions into buttons (actions with no user inputs), inputs (actions with one user input) and forms (actions with multiple user inputs), and then render that, as well as other blink attributes (such as image, title and description) with the help of parser/src/ui/BlinkzActionLayout.tsx

  2. After the user has entered his inputs, values of other inputs are calculated, and provided to the action that is to be done (in case of actions interacting with blockchain). Actions can also just open a link or switch to another CID.

  3. Action is executed with the calculated parameters. You can see the parameter parsing from the previous step, and the action execution logic in parser/src/utils/actionExecuter.tsx

The parser tries to interact with the blockchain using the window.ethereum object, but since the extension's content script can not directly interact with the window.ethereum, we have built the parser to support custom Blinkz evets (as seen in parser/src/utils/blockchain.ts), if window.ethereum is not available.

Links

Support

If you encoutner any issues or have questions, please file an issue on our GitHub Issues page.