Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@permaweb/payments

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@permaweb/payments

> WARNING: This is an experimental library, focused on the Universal Data License.

latest
npmnpm
Version
0.0.13
Version published
Weekly downloads
4
-88.24%
Maintainers
1
Weekly downloads
 
Created
Source

Permaweb Payments Library

WARNING: This is an experimental library, focused on the Universal Data License.

The Permaweb Payments library is a powerful tool that simplifies the handling of licensing workflows and payments on the permaweb. It provides an easy-to-use API for developers to integrate licensing functionality into their applications and interact with the Arweave blockchain.

Features

  • License Workflow: The library facilitates the licensing workflow, allowing developers to check if an address is licensed and initiate payments seamlessly.

  • Payment Handling: Developers can easily integrate payment functionality into their applications using the library. It provides a straightforward API to initiate and process payments on the permaweb.

  • Integration with Arweave: The library integrates with the Arweave blockchain, leveraging its decentralized and permanent storage capabilities for licensing and payment transactions.

Installation

To install the Permaweb Payments library, use the following command:

npm install @permaweb/payments

Usage

To initialize the library, import it into your project and call the init method with the contract and Arweave parameters:

NOTE: It is important to use dependency injection and insert a connected contract with a signer

import Payments from "@permaweb/payments";

const payments = Payments.init({ warp, wallet, gateway });

Check License

To check if an address is licensed, use the isLicensed method:

const isLicensed = await payments.isLicensed(contract, addr);

Make a Payment

To initiate a payment, use the pay method:

await payments.pay(contract, addr);

Examples

Here are some examples to help you get started:

Check License Example

import Payments from "@permaweb/payments";

const payments = Payments.init({ warp, wallet, gateway });

const isLicensed = await payments.isLicensed(atomic-asset-id, wallet-addr);
console.log(`Address ${addr} is licensed: ${isLicensed}`);

Make a Payment Example

import Payments from "@permaweb/payments";

const payments = Payments.init({ warp, wallet, gateway });

await payments.pay(atomic-asset-id, wallet-addr);
console.log(`Payment sent to address: ${addr}`);

Contributions

Contributions to the Permaweb Payments library are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the library's GitHub repository.

License

The Permaweb Payments library is released under the MIT License. Please refer to the LICENSE file for more details.

Thank you for using the Permaweb Payments library. We hope it simplifies the licensing and payment workflows for your permaweb applications. Happy building!

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts