Skip to content

MsgDeleteOutgoingApproval deletes one outgoing approval by ID without rebuilding the full approval list.

Deletes a single outgoing approval for the signer in one collection. It is a wrapper around MsgUpdateUserApprovals.

Example

bash
bb tx tokenization delete-outgoing-approval 1 sell-token-5-to-bob --from alice --chain-id bitbadges-1
ts
import { BitBadgesSigningClient, GenericCosmosAdapter, MsgDeleteOutgoingApproval } from 'bitbadges';

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

const msg = new MsgDeleteOutgoingApproval({
  creator: 'bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d',
  collectionId: 1n,
  approvalId: 'sell-token-5-to-bob'
});

const result = await client.signAndBroadcast([msg]);
console.log(result.txHash, result.success);
json
{
  "creator": "bb1p0rrel3365scadq5k9pv0x0zp9j22js6dnw70d",
  "collectionId": "1",
  "approvalId": "sell-token-5-to-bob"
}

Fields

FieldTypeRequiredDescription
creatorstringyesSigner. Users can only delete their own approvals.
collectionIdUintyesCollection. "0" resolves to the most recently created collection.
approvalIdstringyesID of the outgoing approval to delete.

Response

FieldTypeDescription
foundboolWhether the approval existed. Always true on success; a missing ID is an error.
versionstringVersion of the deleted approval.
reviewItemsstring[]Advisory notes.

Behavior

  • Loads the signer's current outgoing approvals (or the collection defaults) and removes the entry with approvalId.
  • Fails with ErrApprovalNotFound if no outgoing approval has that ID.
  • Runs the full MsgUpdateUserApprovals path with updateOutgoingApprovals: true, so canUpdateOutgoingApprovals and the archived check apply.

Edit this page on GitHub