Skip to content

closecampgn ​

Summary ​

This action will allow manager to remove all whitelist users from campaign, and once whitelist is empty, campaign will be deleted. If campaign have a large whitelist, this action might fail when trying to remove users.

Action Parameters ​

Property NameC++ TypeJavaScript TypeDescription
campaigneosio::nameStringThe name of the campaign
managereosio::nameStringThe account that will act as manager of the campaign
limituint32_tNumberHow many whitelist users to remove from the campaign. If 0, try to remove all entries and delete campaign

Required Permissions: manager

CLI - cleos ​

shell
cleos push action ultra.rgrab closecampgn '["testcampaign", "manager", 0]' -p manager

Javascript - eosjs ​

typescript
(async () => {
    const result = await api.transact(
        {
            actions: [
                {
                    account: 'ultra.rgrab',
                    name: 'closecampgn',
                    authorization: [
                        {
                            actor: 'manager',
                            permission: 'active',
                        },
                    ],
                    data: {
                        campaign: 'testcampaign',
                        manager: 'manager',
                        limit: 0
                    },
                },
            ],
        },
        {
            blocksBehind: 3,
            expireSeconds: 30,
        }
    );
})();