Wagent Docs
  • Welcome
  • SET UP WAGENT
    • Create an account
    • Install a plugin for your CMS
    • Use the SDK
    • Change your preferences
    • Stream Payments
  • Contracts
    • Wagent V1
    • Deployed Addresses
  • API
    • Introduction
    • Create an order
    • Get order details
  • Plugins
    • WordPress
    • PrestaShop
    • Shopify
    • Magento
    • Joomla
    • OpenCart
Powered by GitBook
On this page
  1. Contracts

Wagent V1

The Wagent contract is fully open-source, unupgradeable, and trustless, allowing anyone to use it with confidence. It acts as a proxy between the payer and the merchant, handling payments in a secure and decentralized manner. The contract offers two primary functions: pay and pay_stream.

Before interacting with the contract, ensure that the sender (or payment creator) has set sufficient allowance for the contract address. This allows the contract to transfer the necessary tokens to complete the payment.

pay

The pay function facilitates direct, one-time payments and is structured as follows:

fn pay(
    e: Env,
    token_address: Address,
    sender: Address,
    receiver: Address,
    amount: i128,
    order_id: String,
);

pay_stream

The pay_stream function supports streaming payments over a specified duration and is written as:

fn pay_stream(
    e: Env,
    token_address: Address,
    sender: Address,
    receiver: Address,
    amount: i128,
    order_id: String,
    duration: u64,
    minimum_cancellable_duration: u64,
) -> u64;
PreviousStream PaymentsNextDeployed Addresses

Last updated 8 months ago

This function leverages the Fluxity contract, meaning that once called, the payer can monitor their active stream through the Fluxity Dashboard .

here