Skip to content

claimrewards ​

Summary ​

This action will allow user to claim reward from campaign using their whitelisted wallets.

Action Parameters ​

Property NameC++ TypeJavaScript TypeDescription
campaigneosio::nameStringThe name of the campaign
wallet_idstd::vector<uint8_t>StringThe wallet owned by the user which is registered in the campaign's whitelist

Required Permissions: user

CLI - cleos ​

shell
cleos push action ultra.rgrab claimrewards '["testcampaign", "448e3de41c8b52750c664f57fe023a730bcc0047"]' -p user

Javascript - eosjs ​

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