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

@metaworklabs/macha-dev-sdk

v1.1.27

Published

Single SDK to integrate actions and content from multiple protocols

Downloads

79

Readme

Macha SDK

This SDK can be used to connect and access data from multiple protocols without separatly integrating each one of them.

Introduction

Macha dev sdk can be used for interacting with multiple protocols to access data or perform actions on them without individually integrating them in your application.

This allows developers to have the flexibility to perform inter-protocol operations i.e. having different source and triggers on either same or multiple protocols.

Under the hood the SDK uses

  • Typescript
  • ethers.js
  • Graph and GraphQL

Getting Started

Installing Packages

To get started with using Macha SDK, you can install it with npm or yarn

npm install @metaworklabs/macha-dev-sdk

yarn add @metaworklabs/macha-dev-sdk

Usage

Initializing

  • clientId - address of the client of whose metas you need to access
  • signer - wallet signer object
  • metas - list of all enabled metas owned by the clientId
import { Macha, Meta } from '@metaworklabs/macha-dev-sdk/lib';
import {ethers} from "ethers";

const signer: ethers.Signer = signer; // getting from your wallet

const client = new Macha({owner:clientId , signer: signer});

// get enabled metas from the Client.
const metas = client.client?.metasEnabled?.data;

Executing

// executing meta origins
const meta = new Meta(metaId);
const response = await meta.fetchMetaOrigin(requestParams, originIndex);

// trigger
const responseTrigger = await meta.triggerMeta(requestParams, triggerIndex);

Platform Supported

  • React.Js, Next.Js, React Native

Input schema for Meta Creation

{
    id: "",
    name: "Mint Kudos",
    description: "Returns a list of wallet token objects for the specified address.",
    image: "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
    clientId: "0x4eff290c1a734411b39aaa96eabe1e25f0e223ae",
    triggers: {
        "1": {
        id: "1",
        slug: "qwertyuiop123",
        name: "sample_trigger_1",
        description: "This is a sample trigger 1",
        requestType: "CONTRACT",
        requestMethod: "updatePing",
        requestEndpoint:
            "0x66290530D75bB75cbD92e7cF07ef76B8D367f328",
        requestParams: {
            title: "Trigger_params_1",
            type: "object",
            properties: {
            id: {
                type: "string",
            },
            name: {
                type: "string",
            },
            age: {
                type: "integer",
                minimum: 0,
            },
            },
            additionalProperties: false,
            required: ["id", "name"],
        },
        requestSchema: [], // Contract -> ABI, Graph -> Query, REST -> URL
        requestSchemaCid: "",
        responseSuccess: {},
        responseError: {},
        },
        "2": {
        id: "2",
        slug: "iyuriuw",
        name: "sample_trigger_2",
        description: "This is a sample trigger 2",
        requestType: "CONTRACT",
        requestMethod: "accountDetails",
        requestEndpoint:
            "0x66290530D75bB75cbD92e7cF07ef76B8D367f328",
        requestParams: {
            title: "Trigger_params",
            type: "object",
            properties: {
            firstName: {
                type: "string",
            },
            lastName: {
                type: "string",
            },
            age: {
                type: "integer",
                minimum: 0,
            },
            },
            additionalProperties: false,
            required: ["firstName", "lastName"],
        },
        requestSchema: [],
        requestSchemaCid: "",
        responseSuccess: {},
        responseError: {},
        },
    },
    origin: {
        requestType: "REST",
        requestMethod: "GET",
        requestEndpoint: "https://api.mintkudos.xyz/v1/wallets/{{address}}/tokens",
        requestParams: {
        address: "string",
        },
        requestSchema:"",
        requestSchemaCid: "",
        requestHeaders: {},
    },
    source: {
        network: "hyperspace",
        chainId: "3141",
        contractAddress: "0xAC6E98027A0bDE7d8c2EAe94427593dc25fc63F4",
    },
    prevIpfsCid: "",
    mapping: {},
}