PHP library to use IOTA REST API to help node management and tangle queries

Overview

iota.php

Discord Apache-2.0 license

About

PHP library to use IOTA REST API to help node management and tangle queries.

Please be aware that this library is in an early development state and the API of the library as well as the IOTA protocol is subject to change, it is NOT ready to use in production.

Requirements

  • PHP8+
  • PHP Extensions: php_curl

Example

info(); ">

  // include iota lib
  require_once("../iota.php");
  // create client
  $client = new iota('https://api.lb-0.testnet.chrysalis2.com');
  // print result of node information
  echo $client->info();

Additional Examples

Please find other examples in the ./examples folder.

Joining the discussion

If you want to get involved in the community, need help with getting set up, have any issues or just want to discuss IOTA, feel free to join our Discord.

You might also like...
Пакет позволяющий работать с REST API SMS-сервиса «SMS Aero»

SMS-сервис «SMS Aero» 💬 Пакет позволяющий работать с REST API SMS-сервиса «SMS Aero» 💡 Изменения: Все заметные изменения в этом проекте будут задоку

PHP library with ready-to-use Yunbi API implementation.

yunbi-client-php A simple PHP client for Crypto Trade Site Yunbi.com Quick example ?php require_once('lib/yunbi-client.php'); try { $client = new

OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

A Laravel package to help integrate Shopware PHP SDK much more easier

Shopware 6 Laravel SDK A Laravel package to help integrate Shopware PHP SDK much more easier Installation Install with Composer composer require sas/s

Simple papara payment api that you can use without the need for an activation key
Simple papara payment api that you can use without the need for an activation key

PaparaQrApi Papara QR Api Simple papara payment api that you can use without the need for an activation key. Explore the docs » View Demo About The Pr

Just a simple API PHP library with basic functions and config.

Installation Clone this Repository in your PHP Project git clone https://github.com/maximilianosinski/simple-api-php-library.git Change your Project n

Lightweight PHP library for WhatsApp API to send the whatsapp messages in PHP provided by ultramsg.com

Ultramsg.com WhatsApp API PHP SDK Lightweight PHP library for WhatsApp API to send the whatsappp messages in PHP provided by Ultramsg.com Installation

Google-api-php-client - A PHP client library for accessing Google APIs

Google APIs Client Library for PHP Reference Docs https://googleapis.github.io/google-api-php-client/main/ License Apache 2.0 The Google API Client Li

BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

BeckhoffPLCSoapClient - SoapClient to communicate with BeckHoff PLC. Library made in PHP based on TcAdsWebService JavaScript Library.

Comments
  • PHP Deprecated warning running example

    PHP Deprecated warning running example

    When you run

    php 01_useWallet.php
    

    from commandline under Windows 11 using PHP 8.1.4 you get this warning:

    PHP Deprecated:  hash_init(): Passing null to parameter #3 ($key) of type string is deprecated in C:\temp\iota.php\src\Helper\Hash.php on line 50
    
    Deprecated: hash_init(): Passing null to parameter #3 ($key) of type string is deprecated in C:\temp\iota.php\src\Helper\Hash.php on line 50
    
    invalid 
    opened by JannemanDev 1
  • searchAdresses cannot search AddressIndexes if AccountIndex is zero

    searchAdresses cannot search AddressIndexes if AccountIndex is zero

    If you want to search adresses only from index 0 you have to select "1" but like in the other functions it would better to be able select index zero with a "0"

    As example $found = $wallet->searchAddresses(0,5, false); would return nothing as well as i want to search for the first adrreses of indexes $found = $wallet->searchAddresses(5,0, false);

    You can see my solution below for that problem:

    public function searchAddresses(int $maxAccountIndex = 5, int $maxAddressIndex = 5, bool $zeroBalance = false): array { 
       $_ret = []; 
       for($_i = 0; $_i <= $maxAccountIndex; $_i++) { 
         for($_j = 0; $_j <= $maxAddressIndex; $_j++) { 
           $_r = $this->address($_i, $_j); 
           if(($_r->getBalance()) == 0 && $zeroBalance == false) { 
             continue; 
           } 
           $_ret[] = $_r->__toArray(); 
         } 
       } 
      
       return $_ret; 
     } 
    

    https://github.com/iota-community/iota.php/blob/c9e85779d313eaeaa0b22920e6e2e8d2d0c1f734/src/Wallet.php#L105-L118

    opened by kaktus2 1
  • Conflicting The message has a conflict and will not be included in the ledger.

    Conflicting The message has a conflict and will not be included in the ledger.

    Great library 👍 Anyone have an idea why that is?

    https://explorer.iota.org/mainnet/message/57ccda55ca0f4f0e4ba90c9469cdb4606fc7d829cc92671b036428f4365a35f3

    question 
    opened by webgreat 1
  • PHP standards

    PHP standards

    Hello, thanks for working on this!

    Seems a few common PHP standards are not followed in this package:

    1. PSR-0 / PSR-4 autoloading structure
    2. No Composer support, requires 1.
    3. PSR-2 / PSR-12 coding style
    4. PDS skeleton guidelines
    5. unit tests, mutation tests
    6. static analysis

    Do you feel this is something you're interested in as a general direction?

    opened by dkarlovi 1
Releases(1.5.2)
  • 1.5.2(Dec 29, 2021)

    1.5.2 - 2022-08-15

    Lib Update (fix)

    Changed

    • fix: No confirmed transaction if PayloadIndexation is empty

    1.5.1 - 2022-07-11

    Lib Update

    Added

    • Example: 06_sendTokenAndCheckTranscation

    Changed

    • SingeNodeClient, network is now public

    1.5 - 2022-05-16

    This library is functionally complete for the IOTA Chrysalis network

    0.5.5 - 2022-02-07

    Lib Update (fix)

    Changed

    • fix: ($value) must be of type Countable|array, IOTA\Api\ResponseArray given
    • example update: 05_fetchMessage

    0.5.4 - 2022-02-06

    Lib Update

    Added

    • Example: SingleNodeClient 10_getOutput.php

    Changed

    • sendTokens now check output type 1 if 0 is empty
    • fix docs
    • fix Identity check messageIds

    0.5.3 - 2022-01-24

    Lib Update

    Added

    • JSON: ArrayAccess
    • Converter: add methods string2Int, string2UInt16, string2BigInt
    • Ed25519Address: add method toAddressBase58
    • Converter: add method xorBytes

    Changed

    • ApiCaller: fetchJSON returns JSON width useJSONHandler = false
    • JSON: new methods to call as Array
    • Network: switch default Network to "devnet"
    • ApiCaller: update default value from $route
    • Models/TraitSerializer: calls Converter methods
    • UnitTest: FaucetClientTest add new Ouput Message
    • Wallet : add method subSeed to create a subSeed from the Seed
    • Wallet: fix docs
    • ApiCaller: param (bool)useJSONHandler
    • Ed25519Seed: Input now allows base58 decoded input
    • Ed25519: statics now public

    0.5.2 - 2022-01-20

    Api Update

    Added

    • Api/ResponseArray

    Changed

    • Api now uses ResponseArray (Object) instead of array
    • Example SingleNodeClient/02_getNodeInfo

    0.5.1 - 2022-01-05

    Network Update

    Added

    • IOTA 1.5 Comnet
    • Faucet setting to network class

    Changed

    • set comnet as default network (reason: PoW is disabled in default devnet node)
    • binding faucet api call to network class

    0.5.0 - 2021-12-29

    Interact with an IOTA PermaNode (Chronicle)

    Added

    • PermaNodeClient (Interact with Chronicle API)

      (health, info, message, messageFind, messageChildren, messageMetadata, milestone, output)

    • Examples (PermaNodeClient)

      • 01_getNodeHealth
      • 02_getNodeInfo
      • 04_getMessage
      • 05_fetchMessage
      • 09_getMilestone ###
    Source code(tar.gz)
    Source code(zip)
  • 0.4.2(Sep 6, 2021)

    0.4.2 - 2021-12-12

    Library update

    Added

    • example DIDmnemonic
    • Wrapper for Mnemonic, Ed25519Seed
    • DID conflict error

    Changed

    • update help (mnemonic example)
    • use object (Util\Keys) instead of array
    • remove ':test' method form DID scheme
    • change readme banner
    • fix composer.json (case sensitive)

    0.4.1 - 2021-10-05

    TESTNET to DEVNET update

    Changed

    • Network class
    • SingleNodeClient
    • FaucetClient
    • Unit tests

    0.4.0 - 2021-09-06

    Iota DID, create/manipulate/verify IOTA Identity.

    Added

    • Identity classes
    • Canonicalie JSON
    • decode, encode base58
    • Util Keys
    • Identity examples
    • Identity help

    Changed

    • Help
    • Check the parameters if isHex
    • Keypair from Seed > 64
    Source code(tar.gz)
    Source code(zip)
    iota.phar(212.05 KB)
  • 0.3.0(Jun 30, 2021)

    0.3.0 - 2021-07-25

    Connects you to the testnet / mainnet more easily and automatically has the settings for the node, explorer and bech32HRP.

    Added

    • Util\Network class

    Changed

    • SingeNodeClient
    • Builder
    • unitTests

    0.2.3 - 2021-07-12

    Added

    • get Historic Balances
      • Add new Wallet/Address method
      • Add Example Wallet/05_WalletGetHistoricBalances
      • Add Help Wallet/020_examples_wallet_getHistoricBalance

    0.2.2 - 2021-07-01

    Added

    • Helper\Amount

    Changed

    • Helper\ApiCaller default timeout = 30
    • FaucetClient timeout handle

    0.2.1 - 2021-06-30

    Added

    • Wallet Help
      • useWallet
      • searchWalletAddress
      • sendTokens

    Changed

    • searchAddresses
      • zeroBalance default to false

    0.2.0 - 2021-06-30

    Added

    • Wallet class
      • address management
      • get Balance over Wallet\Address
      • send Tokens over Wallet\Address
      • Address Searcher
    Source code(tar.gz)
    Source code(zip)
    iota.phar(184.84 KB)
Owner
IOTA Community
Open source projects from the IOTA community.
IOTA Community
A PHP library for communicating with the Twilio REST API and generating TwiML.

twilio-php The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio API c

Twilio 1.4k Jan 2, 2023
Nexmo REST API client for PHP. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.

Client Library for PHP Support Notice This library and it's associated packages, nexmo/client and nexmo/client-core have transitioned into a "Maintena

Nexmo 75 Sep 23, 2022
High performance Clickhouse PHP lib with progress tracking, parametric queries and compression support

Clickhousy High performance Clickhouse PHP library featuring: Tiny memory footprint based on static class (times better than smi2 client) High level m

Denys Golotiuk (hacking) 5 Dec 24, 2022
This library is for integration with Salesforce via REST API.

xsolve-pl/salesforce-client Introduction This library is for integration with Salesforce via REST API. Licence This library is under the MIT license.

Boldare / XSolve Sp. z o.o. 31 Oct 13, 2022
Twitter REST API for PHP 5.3+

README The Wid'op Twitter REST library is a modern PHP 5.3+ API allowing you to easily interact with Twitter 1.1. In order to sign your request with t

Wid'op 24 Aug 10, 2020
Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services

Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services

Xendit 96 Jan 6, 2023
This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via PHP

This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via PHP

Twilio SendGrid 1.4k Dec 27, 2022
Wise-php - This library is written to accommodate the wise API's use in php projects With Wise

Wise-php - This library is written to accommodate the wise API's use in php projects With Wise you can automate payments, connect your business tools, and create ways to manage your finances. You can also power your cross-border and domestic payouts.

Albert Xhani 15 Nov 17, 2022
Interacting with Mastodon's REST API for Kirby v3

Kirby3 Mastodon This plugin provides access to your Mastodon statuses, called 'toots'. Getting started Use one of the following methods to install & u

Fundevogel 5 Dec 31, 2022