Hive-Engine: How to sell your Dust Token - Wie verkauft man seine Staub-Token

DE (EN below)

In meinem letzten Beitrag habe ich gezeigt, wie man mit der HSBI Api ausgeben kann, wer einem HSBI gesponsort hat. Eigentlich wollte ich noch zeigen, wie man anzeigen kann, wem man HSBI gesponsort hat, leider ist die API aber fehlerhaft, sodass dies aktuell nicht möglich ist, mit der API.

Daher gibt es heute etwas anders.

Dustseller

Ich habe mir einmal die Hive-Enginge API angeschaut und mir ein Script erstellt, mit dem ich auf einmal mehrere Token verkaufen kann, so kann ich all die Token verkaufen, die für mich keinen Wert haben. Tatsächlich sind die auch kaum etwas Wert. Bisher musste ich jeden Token einzeln auf Hive-Engine verkaufen, was pro Token einige Zeit beanspruchte. Nun muss ich nur auswählen, welche ich verkaufen will und kann es mit einem Klick.

Das Beispiel findet ihr hier, nutzt diesen nur Lokal, gebt nie euren privaten Aktiv-Schlüssel auf jsfiddle ein!

Am einfachsten nutzt man die API, indem man die Javascriptdateien einbindet (Zeile 3 und 5). In Zeile 8 wird dann die API initialisiert.

In Zeile 204 ff werden die Daten mithilfe der API geladen, dafür wird die find-Methode mit unterschiedlichen Parametern genutzt. Einmal um die Marktdaten zu erhalten, die u.a. das höchste Gebot für einen Token beinhalten, und um die Token eines Users zu erhalten.

Nach Erhalt der Daten wird eine Tabelle mit den Token des Users erstellt und Checkboxen hinzugefügt. Die Tabelle wird nach dem Wert der vorhandenen Token sortiert, die Sortierung kann über eine Checkbox geändert werden.

Damit man nicht immer die ganzen Token auswählen muss, habe ich mehrere Funktionen eingebaut. So können die ausgewählten Token, mit einem Komma separiert, ausgegeben werden. Damit kann man wiederum die Token auswählen. Ebenfalls ist es möglich, Token zu sperren, damit keine "guten" Token verkauft werden. Diese werden dann auch nicht ausgewählt, wenn man alle Token auswählt.

Da dies nichts mit Hive selber zu tun hat, gehe ich darauf auch nicht näher ein.

Hat man die Token nun ausgewählt, die man verkaufen will, dann wird über Zeile 147 ff die Token verkauft. Dazu wird ein Custom JSON erstellt, der die Token, die Anzahl der Token und den Verkaufspreis (vorhandenes Höchstgebot) beinhaltet. Dies wird dann über die HiveJS funktion hive.broadcast.customJson an die Blockchain übermittelt.

Die Funktion hatte ich bereits u.a. hier erklärt, dort hatte ich gezeigt, wie Ecencypunkte und Hive-Engine-Token transferiert werden.

Das Script habe ich bereits mehrere Male verwendet, aber seit dennoch vorsichtig, denn einmal verkauft sind die Token natürlich weg!

Wer Fragen hat, kann gern ein Kommentar da lassen. Am besten @mein-senf-dazu erwähnen, damit ich es mitbekomme.

EN

In my last post I showed how you can use the HSBI Api to show who sponsored you HSBI. Actually, I still wanted to show how to display who you have sponsored HSBI to, but unfortunately the API is buggy, so this is currently not possible with the API.

Therefore, today there is something different.

Dustseller

I took a look at the Hive-Enginge API once and made myself a script to sell multiple tokens at once, so I can sell all the tokens that have no value to me. In fact, they're hardly worth anything either. Previously, I had to sell each token individually on Hive Engine, which took some time per token. Now I just have to choose which ones I want to sell and I can do it with one click.

You can find the example here, use this only locally, never enter your private active key on jsfiddle!

The easiest way to use the API is to include the javascript files (line 3 and 5). In line 8 the API is initialized.

In line 204 ff the data is loaded using the API, for this the find method is used with different parameters. Once to get the market data, which includes among other things the highest bid for a token, and to get the tokens of a user.

After obtaining the data, a table with the user's tokens is created and checkboxes are added. The table is sorted by the value of the available tokens, the sorting can be changed by a checkbox.

So that one does not have to select always the whole tokens, I inserted several functions. So the selected tokens can be output, separated with a comma. So you can select the tokens again. It is also possible to lock tokens, so that no "good" tokens are sold. These tokens will not be selected if you select all tokens.

Since this has nothing to do with Hive itself, I won't go into it.

If you have selected the tokens you want to sell, you can sell the tokens with line 147 ff. For this a custom JSON is created, which contains the tokens, the number of tokens and the selling price (existing highest bid). This is then transmitted to the blockchain via the HiveJS function hive.broadcast.customJson.

I had already explained the function among others here, there I had shown how Ecency points and Hive Engine tokens are transferred.

I used the script already several times, but be careful, because once sold the tokens are gone!

If you have any questions, feel free to leave a comment. Best mention @mein-senf-dazu , so that I get it.

Translated with www.DeepL.com/Translator (free version)



0
0
0.000
7 comments
avatar

Congratulations @hive-coding! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You distributed more than 700 upvotes.
Your next target is to reach 800 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

The Hive Gamification Proposal Renewal
Support the HiveBuzz project. Vote for our proposal!
0
0
0.000
avatar

Sag mal, gibt es eine Möglichkeit die HP direkt so auszulesen, um die Zahl in direkt in meinem Exel anzeigen zu lassen?
Aktuell trage ich die immer manuell ein. !BEER

0
0
0.000
avatar

Meinst du, du öffnest excel und quasi zack ist drin?

0
0
0.000
avatar

Ja.

0
0
0.000
avatar

Hmm, kenne mich da mit Excel nicht so gut aus, ich weiß man kann da irgendwie auch DB abfragen machen.

Ich hatte aber auch schon überlegt mir da was zu basteln für die unterschiedlichsten sachen, also Leo, hp und andere Token.

Wenn mein internet wieder geht schau ich mal ob ich da was hinbekomme

0
0
0.000