The feature to delegate SPS rewards to other accounts has been integrated in the API of Splinterlands for about 2 months. I don't know why the development team hasn't written a frontend feature yet, so that other developers have to help themselves and integrate the features into their own pages. But it doesn't feel like a big job for the Splinterlands developers to fully integrate the feature themselves. It is already possible via API and SL. Thanks to the browser console for developers, it is possible to perform the transaction for an SPS delegation. How you can do this via the website Splinterlands.com, you can read here now.
1. Open Splinterlands and open the browser console.
The first thing we do is open Splinterlands.com, which is the game. In the background, every time the page loads, all the information we need is already loaded. We log into Splinterlands into the account that will deliver the delegations. If we are logged in and e.g. on the Battle page, we open the developer console. Either by Ctrl
+ Shift
+ J
or by pressing the F12
key and then switch to the console.
The whole thing will look something like this:
2. perform the SM.Broadcast transaction
The next step is to enter a command in the Console, which we then confirm with Hive-Keychain in the post.
Important: Customize the templates below to your needs.
SM.BroadcastCustomJson('sm_delegate_rewards','Delegate Rewards', {"username":"SPLINTERLANDSACCOUNT","percent":"100","type":"modern"})
Explanation / Adjustments.
SPLINTERLANDSACCOUNT = The account that should receive the SPS Rewards when you claim the rewards.
percent = Number of % that should go to the account. 0 - 100 (2 decimal places are possible. e.g. 25.87% "percent": "25.87"
)
type = Which type of rewards should be delegated? There are currently 8 different values to choose from: modern
, wild
, focus
, season
, nightmare
, license
, land
, brawl
.
If you simply want to transfer all the rewards your account receives to another account with one command, you can simply leave out the type
and enter the following command:
SM.BroadcastCustomJson('sm_delegate_rewards','Delegate Rewards', {"username":"SPLINTERLANDSACCOUNT","percent":"100"})
2.1 Confirm with Keychain and Submit
Now that our code snippet is ready, we press Enter
once and let the Splinterlands page perform the broadcast transaction for us. Immediately Hive-Keychain should come up as a popup where we can take a closer look at the data:
3. cross-check transactions
Now we can take a look at the current state of current delegations - We can do this easily directly via an API call to Splinterlands. You can get all the necessary information in the following AP Call:
https://api.splinterlands.com/players/reward_delegations?username=YOUR_SL_USERNAME
Replace to your Username at the End of the API Call
4. set delegations back to 0.
This works by simply setting the value of the percentage written above in step 2 to 0
. You can optionally set everything here directly to 0 by leaving out the type or by sending a specific type one by one. By resending a valid transaction, the previous value is simply overwritten, i.e. an update is performed. This also means that it is possible to change an existing delegation from e.g. 10 to 20%, if the scholar should perform better and earn more.
Actually a nice workaround to do the delegations at least without frontend function at Splinterlands but still at Splinterlands.
If you have any questions about this, feel free to ask in the comments.