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.
Head to the Palmera SDK docs to learn more about this SDK.
Install the package with yarn or npm:
yarn add @keyper-labs/palmera-module-sdk
npm install @keyper-labs/palmera-module-sdk
There are two ways to create a Palmera 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)
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,
})
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)
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)
If you have any doubts, questions, or need assistance, feel free to reach out! Here you will find how to get support.
This library is released under MIT.