LogoLogo
  • 🚀getting started
    • Intro to Data Unions
    • Build a Data Union
      • 1️Installation And Deployment
      • 2️Integration
    • Build a Data Union with Streamr
      • 1️Create A Data Stream
      • 2️Deploy A Data Union With Streamr Core
      • 3️Integrate Data Union & Stream
      • 4️Publish to Streamr Marketplace
    • Glossary of Terms
  • 📚Main Concepts
    • Roles and Responsibilities
      • 🧑‍💻Admin
      • 🤵JoinPart Agents
      • 🙋Member
      • 🧑‍🔧Protocol Beneficiary
    • Join Server
    • Contract Functions
    • Manage Wallets And Earnings
    • Data Union Observation
    • Add Your Own Token
    • Custom Modules
  • 🧐Resources
    • Existing Data Unions
    • Framework Governance
    • Data Unions UX Best Practices
  • ❓Questions?
    • Ask us on Discord
Powered by GitBook
On this page
  • Get Data Union stats
  • Other relevant query functions are:
  • Managing the Data Union

Was this helpful?

  1. Main Concepts

Data Union Observation

PreviousManage Wallets And EarningsNextAdd Your Own Token

Last updated 2 years ago

Was this helpful?

Observation functions for your data union are provided by the .

You can get stats regarding your members and the earnings connected to your Data Union.

Get Data Union stats

const dataUnion = await DU.getDataUnion(
    DATA_UNION_CONTRACT_ADDRESS
);

const stats = await dataUnion.getStats()

The returned stats object would look something like this:

{
    "activeMemberCount": BigNumber {_hex: '0x00', _isBigNumber: true}
    "inactiveMemberCount": BigNumber {_hex: '0x00', _isBigNumber: true}
    "joinPartAgentCount": BigNumber {_hex: '0x02', _isBigNumber: true}
    "lifetimeMemberEarnings": BigNumber {_hex: '0x00', _isBigNumber: true}
    "totalAdminFees": BigNumber {_hex: '0x00', _isBigNumber: true}
    "totalDataUnionFees": BigNumber {_hex: '0x00', _isBigNumber: true}
    "totalEarnings": BigNumber {_hex: '0x00', _isBigNumber: true}
    "totalRevenue": BigNumber {_hex: '0x00', _isBigNumber: true}
    "totalWithdrawable": BigNumber {_hex: '0x00', _isBigNumber: true}
}

Other relevant query functions are:

dataUnion.getActiveMemberCount();

// returns contract address of the data union
dataUnion.getAddress();

dataUnion.getAdminAddress();

// Get data union admin fee fraction (between 0.0 and 1.0) that admin gets from each revenue event
dataUnion.getAdminFee();

dataUnion.getChainName();

dataUnion.getMemberStats("$memberAddress")
/** 
returns:
{
    earningsBeforeLastJoin: BigNumber {_hex: '0x00', _isBigNumber: true}
    status: "ACTIVE"
    totalEarnings: BigNumber {_hex: '0x00', _isBigNumber: true}
    withdrawableEarnings: BigNumber {_hex: '0x00', _isBigNumber: true}
}
*/

dataUnion.getMetadata();

dataUnion.getNewMemberStipend();

dataUnion.getWithdrawableEarnings("$memberAddress");

Managing the Data Union

The stats view provides an overview of the data union as well as its members and subscribers over time. The members view allows you to manage manual member join requests (requests that did not contain a shared secret).

If you deployed with Streamr the app provides monitoring functions for Admins, showing subscriber numbers, total revenue, join requests and more.

Data unions are listed along with the data products in . Data unions are marked by a data union badge and a members badge showing the current amount of approved members. Click the tile menu to access the data union stats and manage members.

📚
data union client
Streamr Core
Core > Products