Options
All
  • Public
  • Public/Protected
  • All
Menu

The Pod object is the interface for fetching pod data.

The Pod object should not be instantiated directly, use getPod instead.

The following properties are on the object itself:

const {
id, // Pod ID
safe, // Gnosis safe address, aka the Pod address
ensName, // E.g., orcanauts.pod.xyz
admin, // Address of pod admin
imageUrl, // Source of NFT image
imageNoTextUrl, // Source of NFT image without text (used for avatars)
} = await getPod();

Members, EOAs and member Pods can be fetched with the following functions:

const pod = await getPod(podAddress);
// Fetches list of all members from the pod, as an array of Ethereum addresses.
// This includes any pods that may be members of the original pods.
const members = await pod.getMembers();

// Fetches any member EOAs (externally owned accounts). That is, any member that is not a smart contract or pod.
const memberEOAs = await pod.getMemberEOAs();

// Fetches Pod objects for any member pods.
const memberPods = await pod.getMemberPods();

You can also check if a user is a member, admin, or member of those pods with the following functions:

const pod = await getPod(podAddress);

const isMember = await pod.isMember(userAddress);
// Not an async function
const isAdmin = pod.isAdmin(userAddress);

const isAdminPodMember = await pod.isAdminPodMember(userAddress);

// Includes both pods and users as sub pod members.
const isSubPodMember = await pod.isSubPodMember(userAddress);

Hierarchy

  • Pod

Index

Constructors

  • new Pod(identifier: string | number): Pod
  • Note this constructor should not be called directly. Use getPod() instead.

    Parameters

    • identifier: string | number

      Can be either podId or safe address

    Returns Pod

Properties

address: string
property

Gnosis Safe address, duplicate of safe

admin: string
property

Admin address

controller: string
description: string
property

Description of NFT

ensName: string
property

ENS name

id: number
property

Pod ID

imageNoTextUrl: string
property

Link to Pod NFT image with no text

imageUrl: string
property

Link to Pod NFT image

nonce: number
property

Current nonce, i.e., the nonce of the active proposal

safe: string
property

Gnosis Safe address

threshold: number
property

Number of votes required to pass a proposal

Methods

  • batchMintAndBurn(mintMembers: string[], burnMembers: string[], signer?: Signer): Promise<any>
  • Mints and burns members simultaneously.

    Parameters

    • mintMembers: string[]
    • burnMembers: string[]
    • Optional signer: Signer

    Returns Promise<any>

  • burnMember(memberToBurn: string | string[], signer?: Signer): Promise<TransactionResponse | { data: string; to: string }>
  • Burns member(s) from this pod, or returns an unsigned transaction to do so.

    throws

    If signer is not admin

    Parameters

    • memberToBurn: string | string[]

      Can be a single address or an array of addresses

    • Optional signer: Signer

      If a signer is provided, then the tx will execute. Otherwise, an unsigned transaction will be returned.

    Returns Promise<TransactionResponse | { data: string; to: string }>

  • callAsPersona(method: any, args: any[], persona: { address: string; type: string }, sender?: string | Signer): Promise<any>
  • Calls a Pod method via a persona. The persona object can be fetched by using Pod.getPersonas(address) E.g.,

    callAsPersona(
    pod.mintMember,
    [newMember],
    { type: 'admin', address: userAddress },
    signer,
    )

    The sender must be a signer in the admin case, or the address of the sender. The sender must be a member of the relevant pod.

    Parameters

    • method: any
    • args: any[]
    • persona: { address: string; type: string }
      • address: string
      • type: string
    • Optional sender: string | Signer

    Returns Promise<any>

  • changeThreshold(newThreshold: number, signer?: Signer): Promise<any>
  • Changes the threshold for the safe associated with this pod. If a signer is provided, it will execute the transaction. Otherwise it will return the unsigned tx.

    throws

    If signer is not admin

    Parameters

    • newThreshold: number

      new threshold

    • Optional signer: Signer

      Signer of admin

    Returns Promise<any>

  • createRejectProposal(nonce: number, signer: string | Signer): Promise<void>
  • Creates a reject proposal at a given nonce, mostly used to un-stuck the transaction queue

    Parameters

    • nonce: number

      nonce to create the reject transaction at

    • signer: string | Signer

      Signer or address of pod member

    Returns Promise<void>

  • ejectSafe(signer?: Signer): Promise<TransactionResponse | { data: string; to: string }>
  • Ejects a safe from the Orca ecosystem. This zeroes out all ENS + Controller data, removes the Orca module, and burns the pod's MemberTokens If a signer is provided, it will execute the transaction. Otherwise it will return the unsigned tx.

    This function can also clean up data for safes that have already removed the Orca module, but note that the reverse resolver must be zeroed out by the safe manually in this case.

    Parameters

    • Optional signer: Signer

    Returns Promise<TransactionResponse | { data: string; to: string }>

  • getMemberEOAs(): Promise<string[]>
  • Returns list of all member EOAs, not including any smart contract/pod members.

    Returns Promise<string[]>

  • getMemberPods(): Promise<Pod[]>
  • Returns Pod objects of all member pods.

    Returns Promise<Pod[]>

  • getMembers(): Promise<string[]>
  • Returns of list of all member addresses. Members include member pods and member EOAs

    Returns Promise<string[]>

  • getPersonas(address: string): Promise<{ address: string; type: string }[]>
  • Fetches all personas for a given address related to this pod. All personas return as an object indicating the type of the persona and the address of the persona. For members and admins, the persona address is the user's address. For admin pods and sub pods, the persona address is the pod address.

    Parameters

    • address: string

    Returns Promise<{ address: string; type: string }[]>

  • getProposal(identifier: string | number): Promise<Proposal>
  • Gets a specific proposal by either nonce or the safeTxHash.

    Parameters

    • identifier: string | number

      Can be either the proposal id/nonce (preferred), or the safeTxHash

    Returns Promise<Proposal>

  • Returns an array of Proposal objects in reverse chronological order. Defaults to returning 5, which can be overridden by passing { limit: 10 } for example in the options.

    By default, the first Proposal will be the active proposal, if there is one, and then any executed proposals.

    Queued proposals can be fetched by passing { status: 'queued' } in the options. This will return queued proposals, then the active proposal, then executed proposals (up to the requested limit).

    Executed proposals can be fetched by passing { status: 'passed' } or { status: 'rejected' } in the options. This will return only executed proposals.

    Parameters

    Returns Promise<Proposal[]>

  • getSubPodsByMember(address: string): Promise<Pod[]>
  • Returns all sub pods of this pod that an address is the member of.

    Parameters

    • address: string

    Returns Promise<Pod[]>

  • getSuperPods(): Promise<Pod[]>
  • Returns an array of this pod's super pods, i.e., pods that this pod is a member of

    Returns Promise<Pod[]>

  • getSuperProposals(): Promise<Proposal[]>
  • Returns an array of all active super proposals, i.e., active proposals of any super pods

    Returns Promise<Proposal[]>

  • isAdmin(address: string): boolean
  • Checks if user is admin of this pod

    Parameters

    • address: string

    Returns boolean

  • isAdminPodMember(address: string): Promise<boolean>
  • Checks if given address is a member of the admin pod (if there is one) Returns false if there is no admin pod.

    Parameters

    • address: string

    Returns Promise<boolean>

  • isMember(address: string): Promise<boolean>
  • Checks if user is a member of this pod

    Parameters

    • address: string

    Returns Promise<boolean>

  • isPodifyInProgress(): Promise<boolean>
  • isSubPodMember(address: string): Promise<boolean>
  • Checks if given address is a member of any subpods. Returns false if the user is a member of this pod, but not any sub pods

    Parameters

    • address: string

    Returns Promise<boolean>

  • migratePodToLatest(signer?: Signer): Promise<TransactionResponse | { data: string; to: string }>
  • Migrates the pod to the latest version. Signer must be the admin of pod. If a signer is provided, it will execute the transaction. Otherwise it will return the unsigned tx.

    throws

    If signer is not pod admin

    Parameters

    • Optional signer: Signer

      Signer of pod admin

    Returns Promise<TransactionResponse | { data: string; to: string }>

  • mintMember(newMember: string | string[], signer?: Signer): Promise<TransactionResponse | { data: string; to: string }>
  • Mints member(s) to this pod, or returns an unsigned transaction to do so.

    throws

    if signer is not admin

    Parameters

    • newMember: string | string[]

      Can be a single address or an array of addresses

    • Optional signer: Signer

      If a signer is provided, then the tx will execute. Otherwise, an unsigned transaction will be returned.

    Returns Promise<TransactionResponse | { data: string; to: string }>

  • propose(proposal: Proposal | TransactionResponse | { data: string; to: string }, sender: string, opts?: { nonce?: number }): Promise<Proposal>
  • Creates a proposal on the pod.

    If the proposal parameter is in the { data, to } format, this will create a proposal to execute an arbitrary smart contract function on this pod.

    The data parameter is unsigned encoded function data. You can generate this function data a number of ways, our recommended way would be through ethers.Interface.encodeFunctionData. The to parameter should be the smart contract that the function being called belongs to.

    The pod object can also populate these transactions by using the supplied methods with no signer (i.e., pod.mint())

    To create a proposal on the current pod, you can chain the method and the propose method like so:

    await pod.propose(await pod.mint(newMember), podMember);
    

    To create a proposal on the admin pod to mint to a managed pod, you can call the managed pod's method: Note that the pod you call the functions on is important: it determines which pod you are attempting to mint to.

    // It is important that you call mint() from managedPod here
    await adminPod.propose(await managedPod.mint(newMember), adminPodMember);

    In order to create a sub proposal of an existing proposal, you can pass the proposal object to the sub pod's propose method:

    const [superProposal] = await superPod.getProposals();
    // This creates a sub proposal to approve the super proposal.
    await subPod.propose(superProposal, signer);

    // The propose function also returns a Propose object, so you can chain `propose` like so:
    await subPod.propose(
    await superPod.propose(
    await superPod.mint(newMember),
    superPodMember,
    ),
    subPodMember,
    );

    The sender parameter should be the address the proposal is being sent from. This should be a member of the pod for creating a proposal, or a member of a sub pod to create sub proposals.

    Parameters

    • proposal: Proposal | TransactionResponse | { data: string; to: string }
    • sender: string

      Address of sender

    • opts: { nonce?: number } = {}
      • Optional nonce?: number

        Optional nonce. This will create a proposal with the given nonce.

    Returns Promise<Proposal>

  • transferAdmin(addressToTransferTo: string, signer?: Signer): Promise<TransactionResponse | { data: string; to: string }>
  • Transfers admin role from signer's account to addressToTransferTo If a signer is provided, it will execute the transaction. Otherwise it will return the unsigned tx.

    throws

    If signer is not admin

    Parameters

    • addressToTransferTo: string

      Address that will receive admin role

    • Optional signer: Signer

      Signer of admin

    Returns Promise<TransactionResponse | { data: string; to: string }>

  • transferMembership(fromAddress: string, toAddress: string, signer?: Signer): Promise<TransactionResponse | { data: string; to: string }>
  • Transfers a membership. If a signer is provided, it will execute the transaction. Otherwise it will return the unsigned tx.

    throws

    If toAddress is already a member

    throws

    if fromAddress is not a member

    throws

    If provided signer is not the fromAddress

    Parameters

    • fromAddress: string

      Address that is giving up membership

    • toAddress: string

      Address that will receive membership

    • Optional signer: Signer

      If a signer is provided, then the tx will execute. Otherwise, an unsigned transaction will be returned.

    Returns Promise<TransactionResponse | { data: string; to: string }>

Generated using TypeDoc