Skip to content

MsgDeleteCollection deletes a collection and purges its balances and trackers. Manager only, needs canDeleteCollection.

Deletes a collection and all of its state. Only the current manager can sign it, and canDeleteCollection must permit the action at the current time.

Example

bash
bb tx tokenization delete-collection 1 --from alice --chain-id bitbadges-1
ts
import { BitBadgesSigningClient, GenericCosmosAdapter, MsgDeleteCollection } from 'bitbadges';

const adapter = await GenericCosmosAdapter.fromMnemonic(process.env.MNEMONIC!, 'bitbadges-1');
const client = new BitBadgesSigningClient({ adapter, network: 'mainnet' });

const msg = new MsgDeleteCollection({ creator: 'bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d', collectionId: 1n });

const result = await client.signAndBroadcast([msg]);
console.log(result.txHash, result.success);
json
{ "creator": "bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d", "collectionId": "1" }

Fields

FieldTypeRequiredDescription
creatorstringyesSigner. Must be the current manager.
collectionIdUintyesCollection to delete.

The response is empty.

Behavior

  • Fails with ErrCollectionNotExists if the ID is unknown and ErrSenderIsNotManager if the signer is not the manager. The x/gov authority may sign instead.
  • Checks canDeleteCollection for the current block time.
  • Purges every balance, approval tracker, challenge tracker, ETH signature tracker, and approval version for the collection, then removes the collection record.
  • Deletion is permanent. To make a collection read-only instead, use MsgSetIsArchived.

Edit this page on GitHub