package
2.1.0+incompatible
Repository: https://github.com/jackallabs/canine-chain.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

◀ modules

notifications

Contents

  1. Concept
  2. Client
  3. Transaction Messages
  4. Query Requests

Concept

The notifications module is responsible for sending users notifications. It complements the filetree module to enable file sharing.

Client

Below are CLI query and transaction commands to interact with canined.

Query

The query commands allow users to query notifications state.

canined q notifications --help

Transactions

The tx commands allow users to interact with the notifications module.

canined tx notifications --help

Transaction Messages

Below is a full description of valid transaction messages that can be broadcasted to affect state change. These descriptions aim to be "implementation agnostic", i.e., they make sense to both the CLI/Golang and TS implementations.

SetCounter

Set a NotiCounter object on chain that keeps track of how many notifications a user has. Alice will NOT be able to create a notification for Bob unless Bob has set a notiCounter.

NameTypeDescription
creatorStringThe creator and broadcaster of this message. Pass in Bech32 address

Response

NameTypeDescription
NotiCounterStringThe actual count of how many notifications a user has. This will return 0.

CreateNotifications

Create a notification for a recipient

NameTypeDescription
creatorStringThe creator and broadcaster of this message. Pass in Bech32 address
notificationStringThe notification itself.
Please note that the notification keeper does not handle encryption of this string.
addressStringThe recipient address. Pass in Bech32 address

Response

NameTypeDescription
NotiCounterStringThe actual count of how many notifications a user has.

DeleteNotifications

This message will delete the latest notification from the caller's notifications list.

NameTypeDescription
creatorStringThe creator and broadcaster of this message. Pass in Bech32 address

Response

NameTypeDescription
NotiCounterStringThe actual count of how many notifications a user has.

BlockSenders

NameTypeDescription
creatorStringThe creator and broadcaster of this message. Pass in Bech32 address
senderIdsStringa stringified array of Bech32 addresses the user wants to prevent from sending them notifications. E.g., ["addressA","addressB","addressC"]

Response

Coming soon. For now, an empty response with no errors is a good response.

Query Requests

Below is a full description of valid query requests that can be made to retrieve state information. These descriptions aim to be "implementation agnostic", i.e., they make sense to both the CLI/Golang and TS implementations.

GetNotiCounter

Retrieve a user's NotiCounter

NameTypeDescription
addressStringuser's Bech32 address

Response

types.NotiCounter

AllNotificationsByAddress

Retrieve all notifications for a given address

NameTypeDescription
addressStringuser's Bech32 address

Response

[]types.Notifications