stream-protocol / mailstream-api

Built an StreamPay Express App, that exposes an API to send messages with MailStream. StreamPay app will use the MailStream SDK that handles signatures, encryption, and sending the message. In most cases, add a route to an Express App.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project: MailStream SDK for Solana

Project Logo

A JavaScript SDK for integrating Solana blockchain with MailStream messaging and payment service.

Table of Contents

Introduction

The MailStream SDK for Solana is a JavaScript library that allows developers to integrate Solana blockchain with the MailStream messaging service. This SDK provides a set of functions for making payments, sending messages, and interacting with Solana Name Service (SNS).

SDK Demo

Features:

  • Initiate Solana transactions for payments.
  • Compose and send messages via the MailStream API.
  • Register, transfer ownership, and resolve names using Solana Name Service (SNS).

Getting Started

Installation

To use the MailStream SDK in your project, you can install it via npm:

npm install mailstream-sdk

Usage

An example of how to use the SDK to send a payment and send a message:

const mailstreamSDK = require('mailstream-sdk');

// Initialize the SDK with MailStream "Solana" wallet
const wallet = new mailstreamSDK.Wallet('YOUR_WALLET_PRIVATE_KEY');

// Send a payment
const recipientAddress = 'RECIPIENT_SOLANA_ADDRESS';
const amountLamports = 1000000; 
const paymentSignature = wallet.sendPayment(recipientAddress, amountLamports);

// Send a message
const message = {
  to: 'recipient@mailstream.sol',
  subject: 'Hello',
  body: 'This is a test message.',
};
const messageResponse = wallet.sendMessage(message);

console.log('Payment Transaction:', paymentSignature);
console.log('Message Response:', messageResponse);

Solana Name Service (SNS) Integration

To use the Solana Name Service (SNS) features, make sure to deploy the SNS program (smart contract) and set up SNS wallet. Refer to our SNS Integration Guide for detailed instructions.

Program

  • Publickey:

MailStream Integration

To integrate with the MailStream service, make sure you have the necessary MailStream API credentials. Refer to our MailStream Integration Guide for detailed instructions.

Contributing

Welcome contributions from the community. If you'd like to contribute to the project, please read our Contribution Guidelines for details on how to get started.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Built an StreamPay Express App, that exposes an API to send messages with MailStream. StreamPay app will use the MailStream SDK that handles signatures, encryption, and sending the message. In most cases, add a route to an Express App.


Languages

Language:TypeScript 86.2%Language:JavaScript 13.8%