Another way to interact to Respont smart contract. Respont is fully decentralized app for secure communication for each people.
Using Node.js
npm install @respont/app
import * as Respont from "@respont/app";
const respont = new Respont.Connect(walletKey, JSON_RPC);
Note: Connect()
first parameter can be filled with private key or mnemonic phrases.
We are now only supported mumbai polygon testnet (80001
/ 13881
)
const interact = new Interactions(respont);
What can do:
Function to get key location in Oasis Privacy Layer with confidential contract. Return Address
Function to get one last message from/to an address. Parameter: Address Return Message
Function to get interlocutors. Parameters: BeforeHeight and Limit Return array of Message
Function to get messages from a interlocutor. Parameters: BeforeHeight and Limit Return array of Message
Function to send a message to a interlocutor. Parameters: To (Address), message (string), and Media Return: Please refer to ethers transaction return in their documentation
Function to get profile picture of a address. Parameters: Address Return: String with format https url format.
Function to get change profile picture of connected address. Parameters: Media Return: Please refer to ethers transaction return in their documentation
Function to get interlocutors address blocked by connected address. Return: Array Address
Function to block a interlocutor address. Parameter: Address Return: Please refer to ethers transaction return in their documentation
Function to unblock a interlocutor address. Parameter: Address Return: Please refer to ethers transaction return in their documentation
Parameter basically is a string but with 42-character hexadecimal. Please refer to ethers.js documentation.
Parameter with type data integer. The functional is for cursor due to resource efficiency. Example of use is last BlockHeight from Message return
Parameter with type data array contain string which the urls of media (image, file, etc). Note the media urls accepted format is https url.
It is a string with 42-character hexadecimal. Please refer to ethers.js documentation.
It is human-read message object. Object contents:
- FromAddress: Address
- ToAddress: Address
- MessageText: string
- MediaLink: Array Media
- MessageTimestamp: Integer
- BlockHeight: Integer
It is a string with https urls format.
const listen = new Respont.Listen(respont);
listen.on(eventName, functionEventHandler);
Event Name | Argument | Description |
---|---|---|
PictureChanged | Owner(Address), MediaLink(Media) | Notify every address changed their profile picture. |
Sent | Sender(Address), Receiver(Address) | Notify a new message from/to connected address. |
BlockListAdded | Owner(Address), BlockedAddress(Array Address) | Notify every blocked interlocutor by connected address. |
BlockListRemoved | Owner(Address), BlockedAddress(Address) | Notify every ubblocked interlocutor by connected address. |
block | blockNumber(Integer) | Notify every new generated block. |
Detail: Github / SDK Documentation / Architecture Documentation