npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@yayawallet/node-sdk

v1.3.1

Published

node sdk integration

Downloads

24

Readme

YaYa Wallet Node SDK provides integration with YaYa Wallet API, allowing developers to interact with the YaYa Wallet platform programmatically.

NPM Version NPM Install Size NPM Downloads

Getting Started with the YaYa Wallet SDK for Node.js

This guide will walk you through setting up and using the YaYa Wallet SDK in your Node.js application to interact with the YaYa Wallet API.

1. Installation

Before you begin, ensure you have Node.js and npm installed on your system. You can install the SDK via npm using the following command:

npm install @yayawallet/node-sdk

2. Environment Setup

Secure Credentials with a .env File:

  1. Create a file named .env in the root directory of your project. This file will store your API credentials securely, separate from your code.

  2. Add the following lines to the .env file, replacing the placeholders with your actual YaYa Wallet API credentials:

YAYA_API_URL=https://yayawallet.com/api/en
YAYA_TEST_API_URL=https://sandbox.yayawallet.com/api/en
YAYA_API_PATH=/api/en
YAYA_API_KEY=your_yayawallet_api_key
YAYA_API_SECRET=your_yayawallet_api_secret

Important: Never commit your .env file to a version control system like Git, as it contains sensitive information.

3. Using the SDK in Your Code

Now that you have the SDK installed and your credentials set up, you can start using the SDK's functions to interact with the YaYa Wallet API.

Import Required Functions:

Import the specific functions you need from the @yayawallet/node-sdk module. Here's an example of importing the getProfile function:

const { getProfile } = require('@yayawallet/node-sdk');

Make API Calls:

Once you've imported the functions, you can use them to make API calls. For instance, to retrieve a user's profile information:

const { getProfile } = require('@yayawallet/node-sdk');

// Make a request for a profile
getProfile()
  .then((profile) => {
    console.log('User Profile:', profile);
  })
  .catch((error) => {
    console.error('Error fetching user profile: ', error);
  });

// Want to use async/await?
async function getProfileInformation() {
  try {
    const profile = await getProfile();
    console.log(profile);
  } catch (error) {
    console.log('Error fetching user profile: ', error);
  }
}

This is a basic example, and the SDK offers various other functions for interacting with the YaYa Wallet API. Refer to the official SDK documentation for a complete list of available functions and their usage details.

SDK Documentation

List of all functions available in this sdk.

User

getProfile();
searchUser(query); // query can be username, phone number, email
getOrganization();

Transaction

getTransactionListByUser(params); // params = page number
createTransaction(receiver, amount, cause);
transactionFee(receiver, amount);
generateQrUrl(amount, cause);
getTransactionById(id); // id = transaction id
searchTransaction(query); // query = transactionid, username, phone number, email

Transfer

getTransferList();
transferAsUser(institution_code, account_number, amount, ref_code, sender_note, phone);
externalAccountLookup(institution_code, account_number);
getTransferFee(institution_code, amount);

Air Time

buyAirtime(phone, amount);
buyPackage(phone, package);
listPackages(phone);
listRecharges();

Saving

createSaving(amount, action);
withdrawSaving();
claim(request_ids);

Recurring Contract

listAllContracts();
createContract(contract_number, service_type, customer_account_name, meta_data);
requestPayment(contract_number, amount, currency, cause, notification_url, meta_data);
getSubscriptions();
getListOfPaymentRequests();
approvePaymentRequest(id);
rejectPaymentRequest(id);
activateSubscription(id);
deactivateSubscription(id);

EQub

createEqub(
  equb_account,
  title,
  description,
  location,
  latitude,
  longitude,
  period,
  amount,
  private
);
updateEqub(id, title, description, location, latitude, longitude, period, amount, private);
createNewRoundOfEqub(id);
equbPayments(id);
equbRoundsByID(id);
equbRoundsByName(name);
listOfEqubs();
findEqubsByUser();
findEqubByID(id);
findEqubByName(name);
payEqubRound(id, round, payment);
findMembersOfEqub(id);
removeMembersOfEqub(id);
joinEqub(id);
leaveEqub(id);

Bill Payment

createMultipleBill(billArray);
checkBulkImport();
createBill(
  client_yaya_account,
  customer_yaya_account,
  amount,
  start_at,
  due_at,
  customer_id,
  bill_id,
  bill_code,
  bill_season,
  fwd_institution,
  fwd_account_number,
  description,
  phone,
  email
);
billList(client_yaya_account);
findBill(bill_id, client_yaya_account);
updateBill(updatedBill);

Invitation

findByInviter();
createInvitation(country, phone, amount);

Institution

listInstitution(country);

verification

getVerifiedPaymentDetails(data, signature);

Time

getTime();

Generate Signature

generateSignature(timestamp, method, endpoint, body);

API Request

apiRequest(method, path, params, body);

Issues

If you encounter any issues or have suggestions for improvements, please feel free to open an issue on the GitHub Issues page.

License

This SDK is licensed under the ISC License.