Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IDeshare

Git Source

Title: IDeshare

Interface for the Deshare contract

Functions

registerPartner

Register a new partner

function registerPartner(PartnerParams calldata params) external;

Parameters

NameTypeDescription
paramsPartnerParamsPartner registration parameters

registerMerchant

Register a new merchant

function registerMerchant(MerchantParams calldata params) external;

Parameters

NameTypeDescription
paramsMerchantParamsMerchant registration parameters

registerDevice

Register a new device

function registerDevice(DeviceParams calldata params) external;

Parameters

NameTypeDescription
paramsDeviceParamsDevice registration parameters

uploadTransactionBatch

Upload a transaction batch

function uploadTransactionBatch(UploadBatchParams calldata params) external;

Parameters

NameTypeDescription
paramsUploadBatchParamsUpload batch parameters

registerCountry

Register a country

function registerCountry(bytes2 iso2) external;

Parameters

NameTypeDescription
iso2bytes2The ISO2 country code

getVersion

Get the contract version

function getVersion() external view returns (Version memory);

Returns

NameTypeDescription
<none>Versionversion The current version

getStats

Get statistics information

function getStats() external view returns (StatsInfo memory);

Returns

NameTypeDescription
<none>StatsInfostats The current statistics

getDetailedStats

Get detailed statistics information with descriptive labels

function getDetailedStats() external view returns (DetailedStatsInfo memory);

Returns

NameTypeDescription
<none>DetailedStatsInfodetailedStats The detailed statistics with labels and metadata

getPartner

Get partner information by ID

function getPartner(uint256 partnerId) external view returns (PartnerInfo memory);

Parameters

NameTypeDescription
partnerIduint256The partner ID

Returns

NameTypeDescription
<none>PartnerInfopartner The partner information

getPartnerByCode

Get partner information by partner code

function getPartnerByCode(string calldata partnerCode)
    external
    view
    returns (PartnerInfo memory);

Parameters

NameTypeDescription
partnerCodestringThe partner code

Returns

NameTypeDescription
<none>PartnerInfopartner The partner information

partnerExists

Check if a partner exists by code

function partnerExists(string calldata partnerCode) external view returns (bool);

Parameters

NameTypeDescription
partnerCodestringThe partner code

Returns

NameTypeDescription
<none>boolexists Whether the partner exists

getMerchant

Get merchant information by ID

function getMerchant(uint256 merchantId) external view returns (MerchantInfo memory);

Parameters

NameTypeDescription
merchantIduint256The merchant ID

Returns

NameTypeDescription
<none>MerchantInfomerchant The merchant information

getMerchantById

Get merchant information by merchant ID

function getMerchantById(string calldata merchantId) external view returns (MerchantInfo memory);

Parameters

NameTypeDescription
merchantIdstringThe merchant ID (string)

Returns

NameTypeDescription
<none>MerchantInfomerchant The merchant information

merchantExists

Check if a merchant exists by ID

function merchantExists(string calldata merchantId) external view returns (bool);

Parameters

NameTypeDescription
merchantIdstringThe merchant ID

Returns

NameTypeDescription
<none>boolexists Whether the merchant exists

getDevice

Get device information by ID

function getDevice(uint256 deviceId) external view returns (DeviceInfo memory);

Parameters

NameTypeDescription
deviceIduint256The device ID

Returns

NameTypeDescription
<none>DeviceInfodevice The device information

getDeviceById

Get device information by device ID

function getDeviceById(string calldata deviceId) external view returns (DeviceInfo memory);

Parameters

NameTypeDescription
deviceIdstringThe device ID (string)

Returns

NameTypeDescription
<none>DeviceInfodevice The device information

deviceExists

Check if a device exists by ID

function deviceExists(string calldata deviceId) external view returns (bool);

Parameters

NameTypeDescription
deviceIdstringThe device ID

Returns

NameTypeDescription
<none>boolexists Whether the device exists

getTransactionBatch

Get transaction batch by ID

function getTransactionBatch(uint256 batchId) external view returns (TransactionBatch memory);

Parameters

NameTypeDescription
batchIduint256The batch ID

Returns

NameTypeDescription
<none>TransactionBatchbatch The transaction batch

getCountry

Get country information

function getCountry(bytes2 iso2) external view returns (CountryInfo memory);

Parameters

NameTypeDescription
iso2bytes2The ISO2 country code

Returns

NameTypeDescription
<none>CountryInfocountry The country information

countryExists

Check if a country is registered

function countryExists(bytes2 iso2) external view returns (bool);

Parameters

NameTypeDescription
iso2bytes2The ISO2 country code

Returns

NameTypeDescription
<none>boolexists 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

NameTypeDescription
businessTypestringThe business type to query

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
iso2bytes2The ISO2 country code
locationIdstringThe location ID (e.g., city identifier)

Returns

NameTypeDescription
<none>uint256The count of merchants

getTransactionData

Retrieves transaction data for a batch

function getTransactionData(uint256 batchId) external view returns (string memory jsonData);

Parameters

NameTypeDescription
batchIduint256The batch ID to retrieve data for

Returns

NameTypeDescription
jsonDatastringThe transaction data as JSON string