website logo
WebsiteGithubDiscordTwitterTelegram
⌘K
Get started
Welcome to peaq
Introduction to peaq
Our mission
Our vision
Learn
Networks overview
Economics
Tokens & Token Utility
Why Polkadot
Tech stack
Source code
Important links
Security Assessment Reports
Builders
Get started
Build
Integrate
Get inspired
Grants & Funding
Ecosystem and Community Initiatives
User Interfaces
peaq control
peaq App
Node operators
Run a node
Tokens & Earn
Agung tokens (Faucet)
Wallets
Docs powered by archbee 
13min

peaq pay

Payment is required for all transactions involving the purchase or sale of goods or services by machines. The peaq network enables machines to pay and be paid in a secure and autonomous way.

1) Payment for goods and services is made possible by the payment function of the machines. 2) Receive payment for goods and services provided.

The current Version 1 is designed to focus only on transactions between a consumer and a service provider in the network.

An example implementation of peaq pay can be found here. It facilitates:

  • The creation of the multisig wallet where the consumer of the service deposits a certain amount required for a service.
  • Funding multisig wallet using sender’s existing wallet on the network.
  • Approving refund and spent transactions after a completed charging session.

Requirements

  • Multisig Pallet installed on the network.

Installation

[dependencies]peaq-pay = { git = "https://github.com/peaqnetwork/peaq-pay.git", branch = "dev"}

Docs & Usage

On this current MVP, three API methods were exposed;

  • create_multisig_wallet
  • fund_multisig_wallet
  • approve_transaction

create_multisig_wallet(signatories: Vec<String>, threshold: u16) -> Result<String, Error>

signatories: List of wallet addresses of signatories to the escrow account. threshold: Number of signatures needed to release funds on the escrow account. Returns multisig wallet address created using the wallet addresses of all signatories or error.

Example:

create_multisig_wallet


fund_multisig_wallet(ws_url: String, address: String, amount: u128, seed: String ) -> Option<ChainError>

ws_url: Network websocket node address. address: Multisig wallet to fund. amount: Amount to fund the wallet. seed: Secret seed used for signing the transaction. Enum: ChainError pub enum ChainError {  Error(String), None, } Returns an optional ChainError enums.

Example:

fund_multisig_wallet


approve_transaction(params: ApproveTransactionParams) -> Option<ChainError>

approve_transaction_params

ws_url: Network websocket node address. threshold: Number of signatures needed to release funds on the escrow account other_signatories: List of wallet address of signatories (excluding the sender) who can sign this transaction timepoint: A global extrinsic index, formed as the extrinsic index within a block, together with that block's height. This allows a transaction in which a multisig operation of a particular composite was created to be uniquely identified. call_hash: The call to be executed. max_weight: The weight of the call. seed: Secret seed used for signing the transaction
Timepoint


Example:

approve_transaction_code


Upcoming Features

  • Support a stable means of payment with as many local currencies as possible (starting with stable tokens in USD and EURO as primary focus).
  • Support traditional payment methods such as credit cards or bank accounts.
  • Support consumers & providers to on & offramp their peaq tokens.

For source files please refer to : https://github.com/peaqnetwork/peaq-pay#peaq-pay



Did this page help you?
Yes
No
UP NEXT
peaq API Documentation
Docs powered by archbee 
create_multisig_wallet