This is a Web3 Typescript/Javascript client for the SolSplits Protocol, allowing developers to seamlessly interact with the SolSplits ecosystem. The package provides the following categories and a hard-coded value for our program ID:
- Accounts
- Errors
- Instructions
- PROGRAM_ID
npm install @solsplits/solsplits-web3-client
The accounts module exposes four methods for interacting with different account types:
- Config
- Split
- Receiver
- Referral
The errors module contains everything required to handle error logic and exposes different error types for smoother integration.
Instructions are the core of this package, providing all the logic for creating Split Contracts and interacting with the SolSplits Protocol.
import SolSplits from '@solsplits/solsplits-web3-client';
const { Accounts, Errors, Instructions, PROGRAM_ID } = SolSplits
// Example usage with the Accounts module
const configAccount = Accounts.config(params);
// Example usage with the Errors module
try {
// Your logic here
} catch (error) {
if (error instanceof Errors.CustomError) {
console.error('A custom error occurred:', error.message);
}
}
// Example usage with the Instructions module
const createSplitInstruction = Instructions.createSplit(params);
This package is released under the MIT License.
Please see CONTRIBUTING.md for more information.
If you have any questions, issues or feature requests, feel free to open an issue in the repository or reach out to us through our Discord Community.