
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
obyte-browser-chat
Advanced tools
A library for establishing chat sessions between your web-based dapp and the user's Obyte wallet. Use the chat to:
This library uses local storage
yarn add obyte-browser-chat obyte
import browserChat from "obyte-browser-chat"
import obyte from "obyte";
export default new obyte.Client('wss://obyte.org/bb-test'); // or wss://obyte.org/bb for livenet
import browserChat from "obyte-browser-chat";
import client from "..."; // obyte.js client instance
export default browserChat({
name: "mydomain.com", // chat name that'll show up in the user's wallet
client, // obyte.js client instance
testnet: true
});
import browserChatInstance from "...";
const payments = [
{
address: "2QVJOY3BRRGWP7IOYL64O5BU3WLUJ4TZ",
amount: 1e9, // integer, amount in smallest units
asset: "base"
},
{
address: "EJC4A7WQGHEZEKW6RLO7F26SAR4LAQBU",
amount: 2e9,
asset: "base"
}
];
const paymentJsonBase64 = browserChatInstance.generatePaymentString({ payments });
const message = `Send bytes \n[send](payment:${paymentJsonBase64})`;
const link = browserChatInstance.sendMessageAfterPairing(message);
...
<a href={link}>Click</a>
const pairingLink = browserChatInstance.getPairingLink();
Returns a link that looks like obyte:PUB_KEY@obyte.org/bb
. The user needs to click it to open the chat.
const pairingLink = browserChatInstance.sendMessageAfterPairing("We're glad to see you");
As above, plus the provided message will be sent to the user immediately after pairing.
browserChatInstance.onPairing((msgObject) => {
console.log("msgObject", msgObject);
// send a plain text message
msgObject.reply("Hi there!");
// request to sign a text message
msgObject.reply("Please prove ownership of your address by signing this message: [any text](sign-message-request:I confirm for domain.com that I own the address SPV5WIBQQT4DMW7UU5GWCMLYDVNGKECD)");
// request to sign an object
const order = {field1: "value1"};
const orderJsonBase64 = Buffer.from(JSON.stringify(order), 'utf8').toString('base64');
msgObject.reply(`Please sign an order: [any text](sign-message-request:${orderJsonBase64})`);
// request a private profile
msgObject.reply(`Click this link to reveal your private profile to us: [any text](profile-request:first_name,last_name,dob,country,id_type).`);
// request a vote
const objVote = {
poll_unit: '0Vv6lhpjjk3VsKCSGML2NY/5W+WgpsNELQJ1rukhL5Y=',
choice: 'Institute For the Future of the University of Nicosia',
};
const voteJsonBase64 = Buffer.from(JSON.stringify(objVote), 'utf8').toString('base64');
msgObject.reply(`Click to vote for ${objVote.choice}: [any text](vote:${voteJsonBase64}).`);
});
where msgObject
contains:
reply
- message forwarding functionbody
- object with pairing_secret
fieldsender
- sender's public keybrowserChatInstance.onMessage((msgObject) => {
msgObject.reply("Thanks, you said: " + msgObject.body);
});
where msgObject
contains:
reply
- message forwarding functionbody
- received message (string)sender
- sender's public keybrowserChatInstance.onReady(() => {
console.log("I'm connected to the hub");
});
const payments = [
{
address: "2QVJOY3BRRGWP7IOYL64O5BU3WLUJ4TZ",
amount: 1e9,
asset: "base"
},
{
address: "EJC4A7WQGHEZEKW6RLO7F26SAR4LAQBU",
amount: 2e9,
asset: "base"
}
];
const paymentJsonBase64 = chatInstance.generatePaymentString({ payments });
FAQs
Library for interacting with Obyte chat
The npm package obyte-browser-chat receives a total of 6 weekly downloads. As such, obyte-browser-chat popularity was classified as not popular.
We found that obyte-browser-chat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.