IDeshare
Title: IDeshare
Interface for the Deshare contract
Functions
registerPartner
Register a new partner
function registerPartner(PartnerParams calldata params) external;
Parameters
| Name | Type | Description |
|---|---|---|
params | PartnerParams | Partner registration parameters |
registerMerchant
Register a new merchant
function registerMerchant(MerchantParams calldata params) external;
Parameters
| Name | Type | Description |
|---|---|---|
params | MerchantParams | Merchant registration parameters |
registerDevice
Register a new device
function registerDevice(DeviceParams calldata params) external;
Parameters
| Name | Type | Description |
|---|---|---|
params | DeviceParams | Device registration parameters |
uploadTransactionBatch
Upload a transaction batch
function uploadTransactionBatch(UploadBatchParams calldata params) external;
Parameters
| Name | Type | Description |
|---|---|---|
params | UploadBatchParams | Upload batch parameters |
registerCountry
Register a country
function registerCountry(bytes2 iso2) external;
Parameters
| Name | Type | Description |
|---|---|---|
iso2 | bytes2 | The ISO2 country code |
getVersion
Get the contract version
function getVersion() external view returns (Version memory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | Version | version The current version |
getStats
Get statistics information
function getStats() external view returns (StatsInfo memory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | StatsInfo | stats The current statistics |
getDetailedStats
Get detailed statistics information with descriptive labels
function getDetailedStats() external view returns (DetailedStatsInfo memory);
Returns
| Name | Type | Description |
|---|---|---|
<none> | DetailedStatsInfo | detailedStats The detailed statistics with labels and metadata |
getPartner
Get partner information by ID
function getPartner(uint256 partnerId) external view returns (PartnerInfo memory);
Parameters
| Name | Type | Description |
|---|---|---|
partnerId | uint256 | The partner ID |
Returns
| Name | Type | Description |
|---|---|---|
<none> | PartnerInfo | partner The partner information |
getPartnerByCode
Get partner information by partner code
function getPartnerByCode(string calldata partnerCode)
external
view
returns (PartnerInfo memory);
Parameters
| Name | Type | Description |
|---|---|---|
partnerCode | string | The partner code |
Returns
| Name | Type | Description |
|---|---|---|
<none> | PartnerInfo | partner The partner information |
partnerExists
Check if a partner exists by code
function partnerExists(string calldata partnerCode) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
partnerCode | string | The partner code |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | exists Whether the partner exists |
getMerchant
Get merchant information by ID
function getMerchant(uint256 merchantId) external view returns (MerchantInfo memory);
Parameters
| Name | Type | Description |
|---|---|---|
merchantId | uint256 | The merchant ID |
Returns
| Name | Type | Description |
|---|---|---|
<none> | MerchantInfo | merchant The merchant information |
getMerchantById
Get merchant information by merchant ID
function getMerchantById(string calldata merchantId) external view returns (MerchantInfo memory);
Parameters
| Name | Type | Description |
|---|---|---|
merchantId | string | The merchant ID (string) |
Returns
| Name | Type | Description |
|---|---|---|
<none> | MerchantInfo | merchant The merchant information |
merchantExists
Check if a merchant exists by ID
function merchantExists(string calldata merchantId) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
merchantId | string | The merchant ID |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | exists Whether the merchant exists |
getDevice
Get device information by ID
function getDevice(uint256 deviceId) external view returns (DeviceInfo memory);
Parameters
| Name | Type | Description |
|---|---|---|
deviceId | uint256 | The device ID |
Returns
| Name | Type | Description |
|---|---|---|
<none> | DeviceInfo | device The device information |
getDeviceById
Get device information by device ID
function getDeviceById(string calldata deviceId) external view returns (DeviceInfo memory);
Parameters
| Name | Type | Description |
|---|---|---|
deviceId | string | The device ID (string) |
Returns
| Name | Type | Description |
|---|---|---|
<none> | DeviceInfo | device The device information |
deviceExists
Check if a device exists by ID
function deviceExists(string calldata deviceId) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
deviceId | string | The device ID |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | exists Whether the device exists |
getTransactionBatch
Get transaction batch by ID
function getTransactionBatch(uint256 batchId) external view returns (TransactionBatch memory);
Parameters
| Name | Type | Description |
|---|---|---|
batchId | uint256 | The batch ID |
Returns
| Name | Type | Description |
|---|---|---|
<none> | TransactionBatch | batch The transaction batch |
getCountry
Get country information
function getCountry(bytes2 iso2) external view returns (CountryInfo memory);
Parameters
| Name | Type | Description |
|---|---|---|
iso2 | bytes2 | The ISO2 country code |
Returns
| Name | Type | Description |
|---|---|---|
<none> | CountryInfo | country The country information |
countryExists
Check if a country is registered
function countryExists(bytes2 iso2) external view returns (bool);
Parameters
| Name | Type | Description |
|---|---|---|
iso2 | bytes2 | The ISO2 country code |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | exists Whether the country is registered |
getPartnerCountByBusinessType
Get the number of partners for a given business type
function getPartnerCountByBusinessType(string calldata businessType)
external
view
returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
businessType | string | The business type to query |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The count of partners |
getMerchantCountByRegion
Get the number of merchants for a given region
function getMerchantCountByRegion(bytes2 iso2, string calldata locationId)
external
view
returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
iso2 | bytes2 | The ISO2 country code |
locationId | string | The location ID (e.g., city identifier) |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The count of merchants |
getTransactionData
Retrieves transaction data for a batch
function getTransactionData(uint256 batchId) external view returns (string memory jsonData);
Parameters
| Name | Type | Description |
|---|---|---|
batchId | uint256 | The batch ID to retrieve data for |
Returns
| Name | Type | Description |
|---|---|---|
jsonData | string | The transaction data as JSON string |