1. Go to this page and download the library: Download php-core/wert-sc-signer 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/ */
php-core / wert-sc-signer example snippets
use PHPCore\WertScSigner\WertScSigner;
$signedData = WertScSigner::signSmartContractData($options, $privateKey);
use PHPCore\WertScSigner\Laravel\Facades\WertScSigner;
$dataWithSignature = WertScSigner::signSmartContractData($options);
use PHPCore\WertScSigner\Laravel\Facades\WertScSigner;
// Use the default credential (backward compatible)
$dataWithSignature = WertScSigner::signSmartContractData($options);
// Use a specific credential with withCredential()
$dataWithSignature = WertScSigner::withCredential('production')->sign($options);
$dataWithSignature = WertScSigner::withCredential('partner_a')->sign($options);
// Or pass the credential name to the sign() method
$dataWithSignature = WertScSigner::sign($options, 'staging');
// Based on environment
$credential = app()->environment('production') ? 'production' : 'staging';
$dataWithSignature = WertScSigner::withCredential($credential)->sign($options);
// Based on user/tenant
$credential = $user->wert_credential_name ?? 'default';
$dataWithSignature = WertScSigner::withCredential($credential)->sign($options);
// Based on partner
$credential = match($partnerId) {
'partner-a' => 'partner_a',
'partner-b' => 'partner_b',
default => 'default',
};
$dataWithSignature = WertScSigner::withCredential($credential)->sign($options);