Download the PHP package ledgefarm/ledgefarmcore without Composer
On this page you can find all versions of the php package ledgefarm/ledgefarmcore. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ledgefarm/ledgefarmcore
More information about ledgefarm/ledgefarmcore
Files in ledgefarm/ledgefarmcore
Informations about the package ledgefarmcore
Basic Information
PHP package can be used in operator application to communicate with Wakandi network. This package is available on Packagist server [https://packagist.org/] with the name "ledgefarm/ledgefarmcore". This needs to be included as a reference in your application.
Installation
Create a file named composer.json or if you are going to use this package in existing project then put dependency in your composer.json file.
and run following command:-
Configuration
This package uses some configuration to use it. Hence create a base file and in that file make a construct method and set those configurations.
The settings are used to make the application interact with Ledgefarm core.
-
ApiKey: This is the unique key for each operator that is validating the identity of the operator on each request.
-
LedgefarmApiUrl: It is the hosted URL of the Ledgefarm Core API. This URL should end with a version of the application i.e. http://host:port/api/[version]/. As of now, the current version is v1.
-
CertCrtPath: This is the path for the certificate crt file. This file is provided at the time when Ledgefarm Core is setup. Ledgefarm API is protected by client certificate authentication. Each operator will get a certificate to interact with Ledgefarm API. This certificate must be provided to interact with Ledgefarm API.
-
CertKeyPath: This is the path for the certificate key file. This file is provided at the time when Ledgefarm Core is setup. Ledgefarm API is protected by client certificate authentication. Each operator will get a certificate to interact with Ledgefarm API. This certificate must be provided to interact with Ledgefarm API.
- CertPassphrase: This is the key to use the certificate file. Client certificate is protected by a passphrase. The passphrase of certificate must be provided to interact with Ledgefarm API.
Services
Services that are available in this package:
- Wallet Service
- Transaction Service
- Operator Service
- Token Service
Usage
Wallet Service
Wallet service is used to perform all operations related to the wallet like creating wallet, blocking and unblocking a wallet, obtain wallet data etc.
Methods:
-
Create : This function is used to create a wallet. You need to pass a username of the wallet (Walletname) that needs to be created and some basic information about the user to available that wallet for other operator. In response, the package will return the wallet address and access Key for that wallet. This access Key will be used for further operations using this wallet.
-
Get: This function is used to obtain the information of a particular wallet by using there walletname. Admin access Key need to be used here for getting the wallet of a user.
-
GetAll: This function is used to get the list of all the wallets that are registered with the operator. In this limit (pagesize) and offset (starting index position) need to be passed to get the page wise records. Admin access Key need to be used here for getting list of wallets. For example if we have 30 records and page size is 10 then 3 calls need to make with 1,11,21 as offset and 10 as page size in each request.
-
Update: This function is used to update a wallet. The Operator needs to pass a wallet address to update the wallet and information that need to be updated. Admin access key is required for unblocking the wallet.
- Search: This function is used to search a wallet. User can search wallet using wallet address, phone number and email. Admin access key is required for searching the wallet in directory service.
Operator Service
Operator service is used to perform all the operations related Global Network. Which includes get (wallet balance of operator), ownedToken and issuedToken.
Methods:
-
Get: This function is used to get the wallet balance of Operator on Global Network. Admin access key need to be used here for getting balance of an operator.
-
OwnedToken: This function is used to getting information about how much token need to take from another operator. Admin access key need to be used here for getting token information.
- IssuedToken: This function is used to getting information about how many tokens transferred by the operator to the other operator on global network. Admin access key need to be used here for getting token information.
Token Service
Token service is used to perform all the operations related to tokens. Which includes issue, transfer, withdraw and request token etc.
Methods:
-
Issue: This function is used to Issue the token to the user. In this function wallet address of the user to whom token need to be issued, token name, amount and list of all applicable fees need to be passed for the issuing token to the user. Admin access Key need to be used here for issuing token to a user.
-
Transfer : This function is used to transfer the token from one user to another user. In this function wallet address of the user to whom token need to be transferred, token name, amount and list of all applicable fees need to be passed for the transferring token to the user. Here user�s access Key (sender) need to be passed to transfer token from wallet to wallet.
-
Batch transfer : This function is used to transfer tokens from one wallet to List of wallets. The Operator needs to pass wallet address to which the token needs to be transferred, token name, amount, and list of all applicable fees for transferring tokens to the wallet. Here, wallet’s access token (sender) is required to transfer the tokens from wallet.
-
Withdraw: This function is used to withdraw tokens from the user. In this function wallet address of the user from token need to be withdrawn, token name, amount and list of all applicable fees need to be passed for the withdrawing tokens from the user. Admin access Key need to be used to withdrawing tokens from user's wallet.
-
Request: This function is used to request tokens from other user. In this function wallet address of the user from token need to be requested, token name and amount need to be passed for the requesting tokens. User�s access Key (request sender) need to be used here for sending requests to other users.
-
Accept: This function is used to accept token request from other user. In this function tokenRequestId and the fee charged by the operator need to pass for the approving token request. User’s access Key (requestee) need to be used here for approving request.
-
Reject: This function is used to reject token request from other user. In this function tokenRequestId need to pass for the approving token request. User’s access Key (requestee) need to be used here for rejecting request.
- Get: This function is used to to get total supply of the token. Admin’s access Key need to be used here.
Transaction Service
Transaction service is used to get the information of a specific transaction or list of transactions.
Methods:
-
GetAll: This function is used to get the list of all transactions of the operator . In this limit (pagesize) and offset (starting index position) need to be passed to get the page wise records. Admin access Key need to be used here for getting list of transactions. For example if we have 30 records and page size is 10 then 3 calls need to make with 1,11,21 as offset and 10 as page size in each request.
-
Get: This function is used to get the transaction of the operator . Admin access Key need to be used here for getting transaction. We need pass transaction id to get transaction details.
-
GetAllByToken: This function is used to get the list of all transactions of the operator by token . In this limit (pagesize) and offset (starting index position) need to be passed to get the page wise records. Admin access key need to be used here for getting list of transactions. For example if we have 30 records and page size is 10 then 3 calls need to make with 1,11,21 as offset and 10 as page size in each request.
- GetAllByWallet: This function is used to get the list of all transactions of the operatorby wallet . In this limit (pagesize) and offset (starting index position) need to be passed to get the page wise records. Admin access key need to be used here for getting list of transactions. For example if we have 30 records and page size is 10 then 3 calls need to make with 1,11,21 as offset and 10 as page size in each request.