Skip to content

multisigCreateV2: treasury parameter crashes with null despite appearing optional #174

@metasolbot

Description

@metasolbot

Bug

multisigCreateV2 in @sqds/multisig@2.1.4 crashes when treasury is passed as null:

TypeError: null is not an object (evaluating 'pubkey.toBase58')

Why

treasury is passed directly as an account key to createMultisigCreateV2Instruction, which calls .toBase58() on it. Unlike configAuthority (which is serialized via beet.coption and handles null correctly), treasury is a required account — but the function signature doesn't make this obvious.

// From the SDK source:
function multisigCreateV2({ treasury, creator, ... }) {
  return createMultisigCreateV2Instruction(
    {
      programConfig: programConfigPda,
      treasury,      // <-- account key, crashes if null
      creator,
      createKey,
      multisig: multisigPda
    },
    ...
  );
}

Expected

Either:

  1. TypeScript types should mark treasury as PublicKey (not optional/nullable), OR
  2. The SDK should handle null gracefully (e.g. default to SystemProgram.programId or the creator)

Workaround

Pass a valid PublicKey (e.g. the creator address) instead of null:

multisig.instructions.multisigCreateV2({
  treasury: creator,  // not null
  rentCollector: creator,
  configAuthority: PublicKey.default,
  // ...
});

Environment

  • @sqds/multisig@2.1.4
  • @solana/web3.js@1.x
  • Browser (Next.js client-side)

/cc @metasal1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions