PHP code example of twala-io / twala-php

1. Go to this page and download the library: Download twala-io/twala-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

twala-io / twala-php example snippets




// Import a PSR-4 autoloader
pUuid = 'your_app_uuid'; // Replace with your app UUID
$appSecret = 'your_app_secret'; // Replace with your app secret

// Instantiate Twala SDK
$sdk = new \Twala\Sdk($appUuid, $appSecret);

// Generate account keys
$account = $sdk->generateAccountKeys();

// Generate nonce / uuid
$uuid = $sdk->generateNonce();

// Sign document uuid
$signature = $sdk->signDocumentUuid($uuid, $account['private_key']);

// Recover address from signature digest
$recover = $sdk->recoverAddress(
    $signature['message_hash'],
    $signature['v'],
    $signature['r'],
    $signature['s']
);