Skip to content

Latest commit

 

History

History
96 lines (63 loc) · 3.08 KB

README.md

File metadata and controls

96 lines (63 loc) · 3.08 KB

Palmera

npm version GitHub Release GitHub

Software development kit that facilitates the interaction with Palmera Module using a TypeScript interface. This Kit can be used to create on chain organizations, create and execute transactions on behalf, and much more.

Table of contents

Documentation

Head to the Palmera SDK docs to learn more about this SDK.

Installation

Install the package with yarn or npm:

yarn add @keyper-labs/palmera-module-sdk
npm install @keyper-labs/palmera-module-sdk

Quick Start

1. Create a Palmera instance

There are two ways to create a Palmera instance.

a. Initialize with an existing Safe instance

Using an existing Safe instance, you can initialize a Palmera SDK instance.

import Safe from '@safe-global/protocol-kit'
import Palmera from '@keyper-labs/palmera-module-sdk'

const protocolKit = await Safe.create({
  ethAdapter,
  safeAddress,
})

const palmeraSdk = await Palmera.init(protocolKit)

b. Create using a SafeConfig

Using an ethAdapter and a Safe address, the Palmera SDK will create a Safe instance internally and return a new Palmera instance.

import Palmera from '@keyper-labs/palmera-module-sdk'

const palmeraSdk = await Palmera.create({
  ethAdapter,
  safeAddress,
})

2. Prepare your Safe

You need to enable the Palmera module and set the Palmera Guard in order to create a new organization in Palmera.

const tx = await palmeraSDK.setUpSafeTx()
const result = await safeSDK.executeTransaction(tx)

3. Create your first organization

Create and execute a Safe transaction to register your new organization. This requires an organization name, which can be a descriptive name or a random one.

const tx = await palmeraSDK.registerOrganizationTx('Some name')
const result = await safeSDK.executeTransaction(tx)

Let's confirm your first organization and retrieve the org hash from the Safe address.

const isRegistered = await palmeraSDK.isOrganizationRegistered()
const orgHash = await palmeraSdk.getOrgHashBySafe(safeAddress)

Need Help or Have Questions?

If you have any doubts, questions, or need assistance, feel free to reach out! Here you will find how to get support.

License

This library is released under MIT.