Download the PHP package php-core/wert-sc-signer without Composer
On this page you can find all versions of the php package php-core/wert-sc-signer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download php-core/wert-sc-signer
More information about php-core/wert-sc-signer
Files in php-core/wert-sc-signer
Package wert-sc-signer
Short Description PHP library for SmartContracts Wert's requests signing simplification
License MIT
Informations about the package wert-sc-signer
WertWidget Smart Contract Signing Helper
Installation
Usage
Standard PHP
Laravel
The package includes Laravel integration. The service provider and facade will be automatically registered.
-
Publish the configuration file:
-
Add your Wert private key to your .env file:
- Use the facade in your code:
Function signSmartContractData returns the given options array with an addition of a "signature" property. You can pass the result directly to WertWidget initializer.
Using Multiple Credentials
The package supports using multiple API credentials in the same Laravel project. This is useful when you need to:
- Separate credentials by environment (production, staging, etc.)
- Use different credentials for different partners or clients
- Manage multiple Wert accounts
Configuration:
Update your config/wert-sc-signer.php file:
Add the corresponding environment variables to your .env file:
Usage:
Dynamic Credential Selection:
You can select credentials dynamically based on your application logic:
Options
| Property | Required | Type | Description |
|---|---|---|---|
| address | required | string | User's address that will act as a fallback address if a smart contract can't be executed. In case of fallback, Wert will transfer commodity_amount to this address |
| commodity | required | string | List of supported currencies |
| network | optional | string | List of supported currencies |
| commodity_amount | required | numeric | An amount of crypto necessary for executing the given smart contract |
| sc_address | required | string | The address of the smart contract |
| sc_input_data | required | string | Data that will be used for smart contract execution, in the hex format |
Example
Private key
Was given to you during your registration in the Wert system as a partner. If you don't have one, contact Wert.
Requirements
- PHP 8.0 or higher
- ext-sodium
All versions of wert-sc-signer with dependencies
ext-sodium Version *