A JavaScript SDK for integrating Solana blockchain with MailStream messaging and payment service.
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).
- Initiate Solana transactions for payments.
- Compose and send messages via the MailStream API.
- Register, transfer ownership, and resolve names using Solana Name Service (SNS).
To use the MailStream SDK in your project, you can install it via npm:
npm install mailstream-sdk
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);
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.
- Publickey:
To integrate with the MailStream service, make sure you have the necessary MailStream API credentials. Refer to our MailStream Integration Guide for detailed instructions.
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.
This project is licensed under the MIT License - see the LICENSE file for details.