stxmap-rank-shell 1.1.10

Sign up to get free protection for your applications and to get access to all the features.
package/.cspell.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": "0.2",
3
+ "language": "en",
4
+ "words": [
5
+ "addrs",
6
+ "aggs"
7
+ ],
8
+ "flagWords": ["hte", "hight"],
9
+ "ignorePaths": [
10
+ "node_modules/**",
11
+ "other",
12
+ "pw-scripts",
13
+ "sehll-script",
14
+ "**/*.svg"
15
+ ]
16
+ }
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # shell-repo
2
+ some web3 shell
3
+
4
+ # How to use?
5
+
6
+ ### Download using:
7
+ `cd ~ && wget -O /root/btcfullnode-oooooyoung.sh https://github.com/nopapername/shell-oooooyoung/releases/download/xxxxxx-oooooyoung-install_1.0.0/xxxxxx-oooooyoung.sh && chmod +x xxxxxx-oooooyoung.sh`
8
+
9
+ ### Git clone:
10
+ `git clone https://github.com/nopapername/shell-oooooyoung.git`
11
+
12
+ ### install
13
+ Use npm or yarn to add the module to your current project:
14
+ `npm install --save shell-oooooyoung`
15
+ or
16
+ `yarn add shell-oooooyoung`
17
+
@@ -0,0 +1,70 @@
1
+ // ==UserScript==
2
+ // @name backpack-oooooyoung
3
+ // @namespace http://tampermonkey.net/
4
+ // @version v1.1
5
+ // @description oooooyoung's backpack trade script
6
+ // @author oooooyoung
7
+ // @match https://backpack.exchange/trade/*
8
+ // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
9
+ // @grant none
10
+ // @license MIT
11
+ // ==/UserScript==
12
+
13
+ // 请使用在浏览器控制台里
14
+
15
+ const MIN_WAIT_MS = 300;
16
+ const MAX_WAIT_MS = 1000;
17
+ const MIN_SWITCH_MS = 500;
18
+ const MAX_SWITCH_MS = 3000;
19
+
20
+ let tradeCount = 0;
21
+
22
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
23
+
24
+ const findElementsByText = (text, tag) => {
25
+ const elements = document.querySelectorAll(tag);
26
+ return Array.from(elements).filter((div) => div.textContent === text);
27
+ };
28
+
29
+ const clickElementByText = async (text, tag) => {
30
+ const [element] = findElementsByText(text, tag);
31
+ if (element) {
32
+ element.click();
33
+ await sleep(getRandomWait(MIN_WAIT_MS, MAX_WAIT_MS));
34
+ }
35
+ };
36
+
37
+ const executeTrade = async (type) => {
38
+ await clickElementByText(type, "p");
39
+ await clickElementByText("Market", "div");
40
+ await clickElementByText("Max", "div");
41
+ await clickElementByText(type, "button");
42
+ };
43
+
44
+ const getRandomWait = (min, max) => Math.floor(Math.random() * max + min);
45
+
46
+ const performTradeCycle = async () => {
47
+ try {
48
+ tradeCount++;
49
+ console.log(`开始第${tradeCount}次买`);
50
+ await executeTrade("Buy");
51
+ await sleep(getRandomWait(MIN_SWITCH_MS, MAX_SWITCH_MS));
52
+ console.log(`开始第${tradeCount}次卖`);
53
+ await executeTrade("Sell");
54
+ await sleep(getRandomWait(MIN_SWITCH_MS, MAX_SWITCH_MS));
55
+ } catch (error) {
56
+ console.error("发生错误:", error);
57
+ }
58
+ };
59
+
60
+ const startTrading = async () => {
61
+ await sleep(3000);
62
+ while (true) {
63
+ await performTradeCycle();
64
+ }
65
+ };
66
+
67
+ (function () {
68
+ "use strict";
69
+ startTrading();
70
+ })();