MsgDeleteCollection
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
bb tx tokenization delete-collection 1 --from alice --chain-id bitbadges-1import { 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);{ "creator": "bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d", "collectionId": "1" }Fields
| Field | Type | Required | Description |
|---|---|---|---|
creator | string | yes | Signer. Must be the current manager. |
collectionId | Uint | yes | Collection to delete. |
The response is empty.
Behavior
- Fails with
ErrCollectionNotExistsif the ID is unknown andErrSenderIsNotManagerif the signer is not the manager. The x/gov authority may sign instead. - Checks
canDeleteCollectionfor 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.