├── Blocktime_simple.md
├── Difficulty.md
├── Einundzwanzig.md
├── Genesis.md
├── LN.md
├── Mempool.md
├── Mempool_simple.md
├── MoscowTime.md
├── MoscowTime_simple.md
├── README.md
├── Supply.md
└── images
├── 2.PNG
├── 3.PNG
├── 4.PNG
├── 5.PNG
├── add_script.jpg
├── add_widget.jpg
├── blank
├── blocktime.jpg
├── blocktime_gap.jpg
├── create_widget.png
├── diff.jpg
├── einundzwanzig.jpg
├── einundzwanzig2.jpg
├── einundzwanzig3.jpg
├── genesis.jpg
├── lightning.jpg
├── mempool.jpg
├── mempool_simple.jpg
├── moscowtime.jpg
├── moscowtime_simple.jpg
├── pyblock.jpg
├── search_widget.jpg
└── supply.jpg
/Blocktime_simple.md:
--------------------------------------------------------------------------------
1 | # Blocktime Simple
2 |
3 | The 'Blocktime Simple Widget' shows the current blocktime aka blockheight.
4 |
5 | In Line 17, 20, 23 of the script a thousands delimiter can be choosen.
6 |
7 |
8 |
9 |
10 | ## Tutorial
11 |
12 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
13 | 1. Open the app and click the "+" sign on the top right corner
14 | 1. Paste the following script created by [Janna](https://twitter.com/ux3257_):
15 |
16 | ```js
17 | //
18 | // 2022-04 Twitter:@ux3257_ Github:@ux3257
19 | //
20 |
21 |
22 | // get current blockheight from mempool.space
23 | let req = new Request('https://mempool.space/api/blocks/tip/height');
24 | let blockHeight = await req.loadString();
25 |
26 |
27 | // Insert thousands delimiter -> easier to read.
28 | // Select a delimiter: V1(default), V2 or V3.
29 | // If delimiter is not desired put "//" bevor line 26 & 27
30 | let position = blockHeight.length-3;
31 |
32 | // V1: set " " as delimiter
33 | let delimiter = " ";
34 |
35 | // V2: set "." as delimiter
36 | //let delimiter = ".";
37 |
38 | // V3: set "," as delimiter
39 | //let delimiter = ",";
40 |
41 | // If thousands delimiter is not desired put "//" bevor ne next two lines
42 | blockHeight = [blockHeight.slice(0, position), delimiter, blockHeight.slice(position)].join('');
43 | let widget = await createWidget();
44 |
45 |
46 | // Check where the script is running
47 | if (config.runsInWidget)
48 | {
49 | // Runs inside a widget, so add it to the homescreen widget
50 | Script.setWidget(widget);
51 | }
52 | else
53 | {
54 | // Show the medium widget inside the app
55 | widget.presentMedium();
56 | }
57 |
58 | Script.complete();
59 |
60 |
61 | async function createWidget()
62 | {
63 | // Create new empty ListWidget instance
64 | let listwidget = new ListWidget();
65 |
66 | // Set background color
67 | listwidget.backgroundColor = new Color("#002b38");
68 |
69 | // Add widget heading
70 | let heading = listwidget.addText(blockHeight);
71 | heading.centerAlignText();
72 | heading.font = Font.lightSystemFont(73);
73 | //set text color
74 | heading.textColor = new Color("#eeeeee")
75 |
76 | // Return the created widget
77 | return listwidget;
78 | }
79 | ```
80 |
81 | 4. Click on the bottom left corner the "sliders" to name your script. For example: Blocktime
82 | 5. Click close and done
83 | 6. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
84 |
85 |
86 |
87 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
88 |
89 |
90 |
91 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :)
92 |
93 |
94 |
--------------------------------------------------------------------------------
/Difficulty.md:
--------------------------------------------------------------------------------
1 | # Difficulty Adjustment
2 |
3 |
4 |
5 | ## Tutorial
6 |
7 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
8 | 2. Open the app and click the "+" sign on the top right corner
9 | 3. Paste the following script created by [SN](https://twitter.com/__B__T__C__):
10 |
11 | ```js
12 | let req = new Request('https://bitcoinexplorer.org/api/mining/diff-adj-estimate');
13 | let Difficulty = await req.loadString();
14 |
15 | let widget = await createWidget();
16 |
17 | // Check where the script is running
18 | if (config.runsInWidget)
19 | {
20 | // Runs inside a widget so add it to the homescreen widget
21 | Script.setWidget(widget);
22 | }
23 | else
24 | {
25 | // Show the medium widget inside the app
26 | widget.presentMedium();
27 | }
28 |
29 | Script.complete();
30 |
31 | async function createWidget()
32 | {
33 |
34 | // Create new empty ListWidget instance
35 | let listwidget = new ListWidget();
36 |
37 |
38 | // Set new background color
39 | listwidget.backgroundColor = new Color("#000000");
40 |
41 | // add 10 second to now
42 | let nextRefresh = Date.now() + 1000*10
43 |
44 | listwidget.refreshAfterDate = new Date(nextRefresh)
45 |
46 |
47 | // Add widget heading
48 | let heading = listwidget.addText(Difficulty);
49 | heading.centerAlignText();
50 | heading.font = Font.boldSystemFont(88);
51 | heading.textColor = new Color("#eeeeee")
52 |
53 | // Return the created widget
54 | return listwidget;
55 | }
56 | ```
57 |
58 | 4. Click on the bottom left corner the "sliders" to name your script. For example: Difficulty Adjustment
59 | 5. Click close and done
60 | 6. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
61 |
62 |
63 |
64 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
65 |
66 |
67 |
68 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :)
69 |
--------------------------------------------------------------------------------
/Einundzwanzig.md:
--------------------------------------------------------------------------------
1 | # Einundzwanzig Widget
2 | Value4Value: FlashmanBTC@ln.tips or via LNTXBOT FlashmanBTC
3 |
4 | 
5 |
6 | V2 Blockheight 768541
7 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
8 | 2. Open the app and click the "+" sign on the top right corner
9 | 3. Paste the following script created by [FlashmanBTC](https://twitter.com/FlashmanBTC):
10 | 4. You can edit scale if you have a smaller device. Tested it with iPhone 11 Pro and iPhone SE 2020
11 |
12 | ```js
13 |
14 | // Variables used by Scriptable.
15 | // These must be at the very top of the file. Do not edit.
16 | // icon-color: deep-gray; icon-glyph: bolt;
17 | // Einundzwanzig Edition by FlashmanBTC
18 |
19 | // Font scaling for smaller displays
20 | // Scale 0 = iPhone 11 Pro
21 | // Scale -4 = iPhone SE 2020
22 | scale = 0
23 |
24 | // Change currency EUR or USD
25 | currency = "EUR"
26 |
27 | // Change fee order
28 | // 1 = high to low
29 | h_to_l = 0
30 |
31 | // Show infos
32 | // Attention max 5!, 1 = on
33 | show_block = 1
34 | show_fees = 1
35 | show_moscow = 1
36 | show_price = 1
37 | show_supply = 1
38 | show_hash = 0
39 |
40 | // Request data
41 | let req_logo = new Request('https://i.ibb.co/MSSJYtq/Einundzwanzig-logo.png');
42 | let Einundzwanzig = await req_logo.loadImage();
43 |
44 | let req_height = new Request('https://mempool.space/api/blocks/tip/height');
45 | let blockHeight = await req_height.loadString();
46 | let position_block = blockHeight.length-3;
47 | let delimiter_block = " ";
48 | blockHeight = [blockHeight.slice(0, position_block), delimiter_block, blockHeight.slice(position_block)].join('');
49 |
50 | let req_fees = new Request('https://mempool.space/api/v1/fees/recommended');
51 | let Fees = await req_fees.loadJSON();
52 | fast = Fees.fastestFee.toString();
53 | halfHour = Fees.halfHourFee.toString();
54 | hour = Fees.hourFee.toString();
55 |
56 |
57 |
58 | // let req_moscow = new Request('https://bitcoinexplorer.org/api/price/usd/sats');
59 | let req_moscow = new Request('https://blockchain.info/tobtc?currency='+currency+'&value=1');
60 | let MoscowTimeFull = await req_moscow.loadString();
61 | let MoscowTime = Number(MoscowTimeFull).toFixed(8);
62 | MoscowTime = MoscowTime.substring(6);
63 | let position_moscow = MoscowTime.length-2;
64 | let delimiter_moscow = ":";
65 | MoscowTime = [MoscowTime.slice(0, position_moscow), delimiter_moscow, MoscowTime.slice(position_moscow)].join('');
66 | //MoscowTime = Number(MoscowTime).toFixed(8);
67 |
68 | // let req_shitcoin = new Request('https://bitcoinexplorer.org/api/price/usd');
69 | req_shitcoin = new Request('https://blockchain.info/ticker');
70 | let Shitcoin = await req_shitcoin.loadJSON();
71 | // let ShitcoinUSD = await req_shitcoin.loadString();
72 | // let Supply = await req_supply.loadString();
73 | if(currency == "EUR") {
74 | Shitcoin = Shitcoin.EUR.last.toString();
75 | } else {
76 | Shitcoin = Shitcoin.USD.last.toString();
77 | }
78 |
79 | let req_supply = new Request('https://bitcoinexplorer.org/api/blockchain/coins');
80 | let Supply = await req_supply.loadString();
81 | Supply = Math.round(Supply * 100) / 100;
82 | Supply = String(Supply);
83 |
84 | req_hashrate= new Request('https://bitcoinexplorer.org/api/mining/hashrate');
85 | let Hashrate = await req_hashrate.loadJSON();
86 | Hashvalue = Hashrate['1Day'].val.toString();
87 | HashrateAB = Hashrate['1Day'].unitAbbreviation.toString();
88 |
89 | let widget = await createWidget();
90 |
91 | // Check where the script is running
92 | if (config.runsInWidget) {
93 | // Runs inside a widget so add it to the homescreen widget
94 | Script.setWidget(widget);
95 | } else {
96 | // Show the medium widget inside the app
97 | widget.presentLarge();
98 | }
99 |
100 | Script.complete();
101 |
102 | async function createWidget() {
103 | // Create new empty ListWidget instance
104 | let listwidget = new ListWidget();
105 | // Refresh widget
106 | let nextRefresh = Date.now() + 1000*60
107 | listwidget.refreshAfterDate = new Date(nextRefresh)
108 |
109 | // Set new background color
110 | listwidget.backgroundColor = new Color("#151515");
111 |
112 | // Einundzwanzig Logo
113 | let Einundzwanzig_Logo = listwidget.addImage(Einundzwanzig).centerAlignImage();
114 | let Spacer = listwidget.addSpacer(14)
115 |
116 | // Blockheight
117 | if(show_block == 1) {
118 | let blockTitel = listwidget.addText("Blockheight");
119 | blockTitel.centerAlignText();
120 | blockTitel.font = Font.boldSystemFont(16+scale);
121 | blockTitel.textColor = new Color("#FFFFFF");
122 | let block = listwidget.addText(blockHeight);
123 | block.centerAlignText();
124 | block.font = Font.boldSystemFont(40+scale);
125 | block.textColor = new Color("#F7931A");
126 | }
127 |
128 | // Mempool Fees
129 | if (show_fees == 1) {
130 | let feesTitel = listwidget.addText("Mempool Fees");
131 | feesTitel.centerAlignText();
132 | feesTitel.font = Font.boldSystemFont(16+scale);
133 | feesTitel.textColor = new Color("#FFFFFF");
134 | if(h_to_l == 1) {
135 | fees = listwidget.addText(fast + " H | " + halfHour + " M | " + hour + " L");
136 | } else {
137 | fees = listwidget.addText(hour + " L | " + halfHour + " M | " + fast + " H");
138 | }
139 | fees.centerAlignText();
140 | if(fast < 10) {
141 | fees.font = Font.boldSystemFont(40+scale);
142 | } else if(fast < 100) {
143 | fees.font = Font.boldSystemFont(36+scale);
144 | } else {
145 | fees.font = Font.boldSystemFont(30+scale);
146 | }
147 | fees.textColor = new Color("#F7931A");
148 | }
149 |
150 | // Moscow Time
151 | if(show_moscow == 1) {
152 | let moscowTitel = listwidget.addText("Moscow Time");
153 | moscowTitel.centerAlignText();
154 | moscowTitel.font = Font.boldSystemFont(16+scale);
155 | moscowTitel.textColor = new Color("#FFFFFF");
156 | let moscowTime = listwidget.addText(MoscowTime);
157 | moscowTime.centerAlignText();
158 | moscowTime.font = Font.boldSystemFont(32+scale);
159 | moscowTime.textColor = new Color("#F7931A");
160 | }
161 |
162 | // Shitcoin/BTC
163 | if(show_price == 1) {
164 | let shitcoinTitel = listwidget.addText(currency+"/BTC");
165 | shitcoinTitel.centerAlignText();
166 | shitcoinTitel.font = Font.boldSystemFont(16+scale);
167 | shitcoinTitel.textColor = new Color("#FFFFFF");
168 | let shitcoin = listwidget.addText(Shitcoin);
169 | shitcoin.centerAlignText();
170 | shitcoin.font = Font.boldSystemFont(24+scale);
171 | shitcoin.textColor = new Color("#F7931A");
172 | }
173 |
174 | // Bitcoin supply
175 | if(show_supply == 1) {
176 | let supplyTitel = listwidget.addText("Supply");
177 | supplyTitel.centerAlignText();
178 | supplyTitel.font = Font.boldSystemFont(16+scale);
179 | supplyTitel.textColor = new Color("#FFFFFF");
180 | let supply = listwidget.addText(Supply);
181 | supply.centerAlignText();
182 | supply.font = Font.boldSystemFont(24+scale);
183 | supply.textColor = new Color("#F7931A");
184 | }
185 |
186 | // Bitcoin hashrate
187 | if(show_hash == 1) {
188 | let hashTitel = listwidget.addText("Hashrate");
189 | hashTitel.centerAlignText();
190 | hashTitel.font = Font.boldSystemFont(16+scale);
191 | hashTitel.textColor = new Color("#FFFFFF");
192 | let hash = listwidget.addText(Hashvalue+" "+HashrateAB);
193 | hash.centerAlignText();
194 | hash.font = Font.boldSystemFont(24+scale);
195 | hash.textColor = new Color("#F7931A");
196 | }
197 |
198 | // Return the created widget
199 | return listwidget;
200 | }
201 | ```
202 |
203 | 5. Click on the bottom left corner the "sliders" to name your script. For example: Einundzwanzig
204 | 6. Click close and done
205 | 7. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
206 |
207 |
208 |
209 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
210 |
211 |
212 |
213 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :D
214 |
215 |
216 |
217 |
218 |
--------------------------------------------------------------------------------
/Genesis.md:
--------------------------------------------------------------------------------
1 | # Genesis
2 |
3 |
4 |
5 | ## Tutorial
6 |
7 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
8 | 2. Open the app and click the "+" sign on the top right corner
9 | 3. Paste the following script created by [SN](https://twitter.com/__B__T__C__):
10 |
11 | ```js
12 | let req = new Request('https://pbs.twimg.com/media/FIJI-WNWYAghQq6.jpg');
13 | let Genesis = await req.loadImage();
14 |
15 | let widget = await createWidget();
16 |
17 | // Check where the script is running
18 | if (config.runsInWidget)
19 | {
20 | // Runs inside a widget so add it to the homescreen widget
21 | Script.setWidget(widget);
22 | }
23 | else
24 | {
25 | // Show the medium widget inside the app
26 | widget.presentLarge();
27 | }
28 |
29 | Script.complete();
30 |
31 | async function createWidget()
32 | {
33 |
34 | // Create new empty ListWidget instance
35 | let listwidget = new ListWidget();
36 |
37 |
38 | // Set new background color
39 | listwidget.backgroundColor = new Color("#000000");
40 |
41 | // add 77 second to now
42 | let nextRefresh = Date.now() + 1000*10
43 |
44 | listwidget.refreshAfterDate = new Date(nextRefresh)
45 |
46 |
47 | // Add widget heading
48 | let heading = listwidget.addImage(Genesis).centerAlignImage();
49 |
50 | // Return the created widget
51 | return listwidget;
52 | }
53 | ```
54 |
55 | 4. Click on the bottom left corner the "sliders" to name your script. For example: Genesis
56 | 5. Click close and done
57 | 6. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
58 |
59 |
60 |
61 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
62 |
63 |
64 |
65 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :)
66 |
--------------------------------------------------------------------------------
/LN.md:
--------------------------------------------------------------------------------
1 | # Lightning Network.
2 |
3 |
4 |
5 | First number: Number of Nodes.
6 |
7 | Middle number: Number of Channels.
8 |
9 | Last number: Network Capacity.
10 |
11 | ## Tutorial
12 |
13 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
14 | 2. Open the app and click the "+" sign on the top right corner
15 | 3. Paste the following script created by [SN](https://twitter.com/__B__T__C__):
16 |
17 | ```js
18 | let req = new Request('https://1ml.com/statistics?json=true');
19 | let json = await req.loadJSON();
20 |
21 | nodes = json.numberofnodes.toString();
22 | channels = json.numberofchannels.toString();
23 | capacitycalc = json.networkcapacity / 100000000;
24 | capacitycalc = capacitycalc.toFixed(2);
25 | capacity = capacitycalc.toString();
26 |
27 | let widget = await createWidget();
28 |
29 | // Check where the script is running
30 | if (config.runsInWidget) {
31 | // Runs inside a widget so add it to the homescreen widget
32 | Script.setWidget(widget);
33 | } else {
34 | // Show the medium widget inside the app
35 | widget.presentMedium();
36 | }
37 | Script.complete();
38 |
39 |
40 |
41 | async function createWidget() {
42 | // Create new empty ListWidget instance
43 | let listwidget = new ListWidget();
44 |
45 |
46 | // Set new background color
47 | listwidget.backgroundColor = new Color("#000000");
48 |
49 |
50 | // Add widget heading
51 | let heading = listwidget.addText(nodes + " 📟");
52 | let middle = listwidget.addText(channels + " 🔀");
53 | let down = listwidget.addText(capacity + " ☣️");
54 |
55 |
56 | heading.centerAlignText();
57 |
58 | if(nodes < 1,000)
59 | heading.font = Font.boldSystemFont(60);
60 | else if(nodes < 10,000)
61 | heading.font = Font.boldSystemFont(50);
62 | else
63 | heading.font = Font.boldSystemFont(35);
64 |
65 | heading.textColor = new Color("#eeeeee")
66 |
67 |
68 | middle.centerAlignText();
69 |
70 | if(channels < 99,000)
71 | middle.font = Font.boldSystemFont(60);
72 | else if(channels < 100,000)
73 | middle.font = Font.boldSystemFont(50);
74 | else
75 | middle.font = Font.boldSystemFont(35);
76 |
77 | middle.textColor = new Color("#eeeeee")
78 |
79 |
80 | down.centerAlignText();
81 |
82 | if(capacity < 10,000)
83 | down.font = Font.boldSystemFont(50);
84 | else if(capacity < 100,000)
85 | down.font = Font.boldSystemFont(40);
86 | else
87 | down.font = Font.boldSystemFont(30);
88 |
89 | down.textColor = new Color("#eeeeee")
90 |
91 |
92 | // Return the created widget
93 | return listwidget;
94 | }
95 | ```
96 |
97 | 4. Click on the bottom left corner the "sliders" to name your script. For example: Lightning Network
98 | 5. Click close and done
99 | 6. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
100 |
101 |
102 |
103 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
104 |
105 |
106 |
107 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :)
108 |
--------------------------------------------------------------------------------
/Mempool.md:
--------------------------------------------------------------------------------
1 | # Mempool
2 |
3 | Left number: Mempool suggested fee for a fast transaction
4 |
5 | Middle number: suggested fee for a tx to get in a block the next half hour
6 |
7 | Right number: suggested fee for a tx to get in a block the next hour
8 |
9 |
10 |
11 | ## Tutorial
12 |
13 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
14 | 1. Open the app and click the "+" sign on the top right corner
15 | 1. Paste the following script created by [Janna](https://twitter.com/ux3257_):
16 |
17 | ```js
18 | let req = new Request('https://mempool.space/api/v1/fees/recommended');
19 | let json = await req.loadJSON();
20 |
21 | fast = json.fastestFee.toString();
22 | halfHour = json.halfHourFee.toString();
23 | hour = json.hourFee.toString();
24 |
25 | let widget = await createWidget();
26 |
27 | // Check where the script is running
28 | if (config.runsInWidget) {
29 | // Runs inside a widget so add it to the homescreen widget
30 | Script.setWidget(widget);
31 | } else {
32 | // Show the medium widget inside the app
33 | widget.presentMedium();
34 | }
35 | Script.complete();
36 |
37 | async function createWidget() {
38 | // Create new empty ListWidget instance
39 | let listwidget = new ListWidget();
40 |
41 | // Set new background color
42 | listwidget.backgroundColor = new Color("#000000");
43 |
44 | // Add titel
45 | let wdgTitel = listwidget.addText("Mempool");
46 | let wdgDesc = listwidget.addText("High Medium Low");
47 | // Add widget heading
48 | let heading = listwidget.addText(fast + " " + halfHour + " " + hour);
49 |
50 | wdgTitel.centerAlignText();
51 | wdgDesc.centerAlignText();
52 | heading.centerAlignText();
53 |
54 | wdgTitel.font = Font.boldSystemFont(24);
55 | wdgDesc.font = Font.lightSystemFont(16);
56 |
57 | if(fast < 10)
58 | heading.font = Font.boldSystemFont(73);
59 | else if(fast < 100)
60 | heading.font = Font.boldSystemFont(54);
61 | else
62 | heading.font = Font.boldSystemFont(43);
63 |
64 | wdgTitel.textColor = new Color("#eeeeee")
65 | wdgDesc.textColor = new Color("#eeeeee")
66 | heading.textColor = new Color("#eeeeee")
67 |
68 | // Return the created widget
69 | return listwidget;
70 | }
71 | ```
72 |
73 | 4. Click on the bottom left corner the "sliders" to name your script. For example: Mempool
74 | 5. Click close and done
75 | 6. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
76 |
77 |
78 |
79 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
80 |
81 |
82 |
83 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :)
84 |
85 |
86 |
--------------------------------------------------------------------------------
/Mempool_simple.md:
--------------------------------------------------------------------------------
1 | # Mempool Simple
2 |
3 | The 'Mempool Simple Widget' gives a rough overview of the current mempool situation:
4 |
5 | - Left number: Mempool suggested fee for a fast transaction
6 |
7 | - Middle number: suggested fee for a tx to get in a block the next half hour
8 |
9 | - Right number: suggested fee for a tx to get in a block the next hour
10 |
11 |
12 |
13 |
14 | ## Tutorial
15 |
16 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
17 | 1. Open the app and click the "+" sign on the top right corner
18 | 1. Paste the following script created by [Janna](https://twitter.com/ux3257_):
19 |
20 | ```js
21 | //
22 | // 2022-04 Twitter:@ux3257_ Github:@ux3257
23 | //
24 |
25 | // get current mempool infos from mempool.space
26 | let req = new Request('https://mempool.space/api/v1/fees/recommended');
27 | let json = await req.loadJSON();
28 |
29 | fast = json.fastestFee.toString();
30 | halfHour = json.halfHourFee.toString();
31 | hour = json.hourFee.toString();
32 |
33 | let widget = await createWidget();
34 |
35 |
36 | // Check where the script is running
37 | if (config.runsInWidget) {
38 | // Runs inside a widget so add it to the homescreen widget
39 | Script.setWidget(widget);
40 | } else {
41 | // Show the medium widget inside the app
42 | widget.presentMedium();
43 | }
44 | Script.complete();
45 |
46 |
47 | async function createWidget() {
48 | // Create new empty ListWidget instance
49 | let listwidget = new ListWidget();
50 |
51 | // Set new background color
52 | listwidget.backgroundColor = new Color("#4b374a");
53 |
54 | // Add widget heading
55 | let heading = listwidget.addText(fast + " " + halfHour + " " + hour);
56 |
57 | heading.centerAlignText();
58 |
59 |
60 | // decrease font size when digit gets bigger respectively needs more space
61 | if(fast < 10)
62 | heading.font = Font.lightSystemFont(73);
63 | else if(fast < 100)
64 | heading.font = Font.lightSystemFont(51);
65 | else
66 | heading.font = Font.lightSystemFont(43);
67 |
68 | heading.textColor = new Color("#eeeeee")
69 |
70 |
71 | // Return the created widget
72 | return listwidget;
73 | }
74 | ```
75 |
76 | 4. Click on the bottom left corner the "sliders" to name your script. For example: Mempool
77 | 5. Click close and done
78 | 6. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
79 |
80 |
81 |
82 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
83 |
84 |
85 |
86 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :)
87 |
88 |
89 |
--------------------------------------------------------------------------------
/MoscowTime.md:
--------------------------------------------------------------------------------
1 | # Moscow Time
2 |
3 |
4 |
5 | ## Tutorial
6 |
7 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
8 | 2. Open the app and click the "+" sign on the top right corner
9 | 3. Paste the following script created by [SN](https://twitter.com/__B__T__C__):
10 |
11 | ```js
12 |
13 | // get Sats per usd from bitcoinexplorer.org
14 | let req = new Request('https://bitcoinexplorer.org/api/price/usd/sats');
15 | let MoscowTime = await req.loadString();
16 |
17 | // Insert delimiter between digits to get proper MoscowTime
18 | let position = MoscowTime.length-2;
19 | let delimiter = ":";
20 | MoscowTime = [MoscowTime.slice(0, position), delimiter, MoscowTime.slice(position)].join('');
21 |
22 | let widget = await createWidget();
23 |
24 |
25 | // Check where the script is running
26 | if (config.runsInWidget)
27 | {
28 | // Runs inside a widget so add it to the homescreen widget
29 | Script.setWidget(widget);
30 | }
31 | else
32 | {
33 | // Show the medium widget inside the app
34 | widget.presentMedium();
35 | }
36 |
37 | Script.complete();
38 |
39 |
40 | async function createWidget()
41 | {
42 | // Create new empty ListWidget instance
43 | let listwidget = new ListWidget();
44 |
45 | // Set new background color
46 | listwidget.backgroundColor = new Color("#000000");
47 |
48 |
49 | // Add titel
50 | let wdgTitel = listwidget.addText("Moscow time");
51 | wdgTitel.centerAlignText();
52 | wdgTitel.font = Font.boldSystemFont(24);
53 | wdgTitel.textColor = new Color("#eeeeee")
54 |
55 | // Add widget heading
56 | let heading = listwidget.addText(MoscowTime);
57 | heading.centerAlignText();
58 | heading.font = Font.boldSystemFont(73);
59 | heading.textColor = new Color("#eeeeee")
60 |
61 | // Return the created widget
62 | return listwidget;
63 | }
64 | ```
65 |
66 | 4. Click on the bottom left corner the "sliders" to name your script. For example: Moscow Time
67 | 5. Click close and done
68 | 6. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
69 |
70 |
71 |
72 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
73 |
74 |
75 |
76 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :)
77 |
--------------------------------------------------------------------------------
/MoscowTime_simple.md:
--------------------------------------------------------------------------------
1 | # Moscow Time Simple
2 |
3 | The 'Moscow Time Simple Widget' shows the current number of Sats per Dollar in Moskow-Time format.
4 |
5 |
6 |
7 | ## Tutorial
8 |
9 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
10 | 2. Open the app and click the "+" sign on the top right corner
11 | 3. Paste the following script created by [Janna](https://twitter.com/ux3257_):
12 |
13 | ```js
14 | //
15 | // 2022-04 Twitter:@ux3257_ Github:@ux3257
16 | //
17 |
18 |
19 | // get price per bitcoin in usd from bitcoinpricecalc.com
20 | let req = new Request('https://bitcoinpricecalc.com/api?action=price¤cy=USD');
21 | let json = await req.loadJSON();
22 |
23 | price = json.price;
24 | satsPerDollar = (100000000/price).toString();
25 |
26 | // cut digits after decimal
27 | MoscowTime = satsPerDollar.split(".")[0];
28 |
29 | // Insert delimiter between sats/usd digits to get proper MoscowTime
30 | let position = MoscowTime.length-2;
31 | let delimiter = ":";
32 | MoscowTime = [MoscowTime.slice(0, position), delimiter, MoscowTime.slice(position)].join('');
33 |
34 | let widget = await createWidget();
35 |
36 |
37 | // Check where the script is running
38 | if (config.runsInWidget)
39 | {
40 | // Runs inside a widget so add it to the homescreen widget
41 | Script.setWidget(widget);
42 | }
43 | else
44 | {
45 | // Show the medium widget inside the app
46 | widget.presentMedium();
47 | }
48 | Script.complete();
49 |
50 |
51 | async function createWidget()
52 | {
53 | // Create new empty ListWidget instance
54 | let listwidget = new ListWidget();
55 |
56 | // Set new background color
57 | listwidget.backgroundColor = new Color("#003232");
58 |
59 | // Add widget heading
60 | let heading = listwidget.addText(MoscowTime);
61 | heading.centerAlignText();
62 | heading.font = Font.lightSystemFont(73);
63 | heading.textColor = new Color("#eeeeee")
64 |
65 | // Return the created widget
66 | return listwidget;
67 | }
68 | ```
69 |
70 | 4. Click on the bottom left corner the "sliders" to name your script. For example: Moscow Time
71 | 5. Click close and done
72 | 6. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
73 |
74 |
75 |
76 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
77 |
78 |
79 |
80 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :)
81 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Bitcoin Widgets for iOS
2 |
3 | [Tutorial for Blocktime Simple](https://github.com/cercatrova21/iOS_widgets/blob/main/Blocktime_simple.md)
4 |
5 | [Tutorial for Mempool Fees Simple](https://github.com/cercatrova21/iOS_widgets/blob/main/Mempool_simple.md)
6 |
7 | [Tutorial for MoscowTime Simple](https://github.com/cercatrova21/iOS_widgets/blob/main/MoscowTime_simple.md)
8 |
9 | [Tutorial for Mempool Fees](https://github.com/cercatrova21/iOS_widgets/blob/main/Mempool.md)
10 |
11 | [Tutorial for MoscowTime](https://github.com/cercatrova21/iOS_widgets/blob/main/MoscowTime.md)
12 |
13 | [Tutorial for Supply](https://github.com/cercatrova21/iOS_widgets/blob/main/Supply.md)
14 |
15 | [Tutorial for Difficulty Adjustment](https://github.com/cercatrova21/iOS_widgets/blob/main/Difficulty.md)
16 |
17 | [Tutorial for Lightning Network](https://github.com/cercatrova21/iOS_widgets/blob/main/LN.md)
18 |
19 | [Tutorial for Genesis](https://github.com/cercatrova21/iOS_widgets/blob/main/Genesis.md)
20 |
21 | The idea and script was created by [Janna](https://twitter.com/ux3257_) and [SN](https://twitter.com/__B__T__C__). I'm only the tutorial dude
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | There is also a cool widget from PyBlock. Check it out here: [PyBlock Widget.](https://curly60e.github.io/pyblock/)
42 |
43 |
44 |
--------------------------------------------------------------------------------
/Supply.md:
--------------------------------------------------------------------------------
1 | # Total Supply
2 |
3 |
4 |
5 | ## Tutorial
6 |
7 | 1. Install the app "Scriptable" -> [Apple Appstore - Scriptable](https://apps.apple.com/ch/app/scriptable/id1405459188?l=en)
8 | 2. Open the app and click the "+" sign on the top right corner
9 | 3. Paste the following script created by [SN](https://twitter.com/__B__T__C__):
10 |
11 | ```js
12 | let req = new Request('https://bitcoinexplorer.org/api/blockchain/coins');
13 | let Supply = await req.loadString();
14 |
15 | let widget = await createWidget();
16 |
17 | // Check where the script is running
18 | if (config.runsInWidget)
19 | {
20 | // Runs inside a widget so add it to the homescreen widget
21 | Script.setWidget(widget);
22 | }
23 | else
24 | {
25 | // Show the medium widget inside the app
26 | widget.presentMedium();
27 | }
28 |
29 | Script.complete();
30 |
31 | async function createWidget()
32 | {
33 |
34 | // Create new empty ListWidget instance
35 | let listwidget = new ListWidget();
36 |
37 |
38 | // Set new background color
39 | listwidget.backgroundColor = new Color("#000000");
40 |
41 | // add 10 second to now
42 | let nextRefresh = Date.now() + 1000*10
43 |
44 | listwidget.refreshAfterDate = new Date(nextRefresh)
45 |
46 |
47 | // Add widget heading
48 | let heading = listwidget.addText(Supply);
49 | heading.centerAlignText();
50 | heading.font = Font.boldSystemFont(28);
51 | heading.textColor = new Color("#eeeeee")
52 |
53 | // Return the created widget
54 | return listwidget;
55 | }
56 | ```
57 |
58 | 4. Click on the bottom left corner the "sliders" to name your script. For example: Supply
59 | 5. Click close and done
60 | 6. Go to the homescreen, press and hold for a few seconds to make the icons move. Tab on the top left corner the "+" symbol
61 |
62 |
63 |
64 | 7. Scroll down untill you find the "Scriptable" App. Select it and scroll to the right for the full sized version.
65 |
66 |
67 |
68 | 8. Click "Add Widget" and tab the new created widget to edit it. Select the created script and you're done :)
69 |
--------------------------------------------------------------------------------
/images/2.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/2.PNG
--------------------------------------------------------------------------------
/images/3.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/3.PNG
--------------------------------------------------------------------------------
/images/4.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/4.PNG
--------------------------------------------------------------------------------
/images/5.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/5.PNG
--------------------------------------------------------------------------------
/images/add_script.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/add_script.jpg
--------------------------------------------------------------------------------
/images/add_widget.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/add_widget.jpg
--------------------------------------------------------------------------------
/images/blank:
--------------------------------------------------------------------------------
1 | Blank
2 |
--------------------------------------------------------------------------------
/images/blocktime.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/blocktime.jpg
--------------------------------------------------------------------------------
/images/blocktime_gap.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/blocktime_gap.jpg
--------------------------------------------------------------------------------
/images/create_widget.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/create_widget.png
--------------------------------------------------------------------------------
/images/diff.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/diff.jpg
--------------------------------------------------------------------------------
/images/einundzwanzig.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/einundzwanzig.jpg
--------------------------------------------------------------------------------
/images/einundzwanzig2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/einundzwanzig2.jpg
--------------------------------------------------------------------------------
/images/einundzwanzig3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/einundzwanzig3.jpg
--------------------------------------------------------------------------------
/images/genesis.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/genesis.jpg
--------------------------------------------------------------------------------
/images/lightning.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/lightning.jpg
--------------------------------------------------------------------------------
/images/mempool.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/mempool.jpg
--------------------------------------------------------------------------------
/images/mempool_simple.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/mempool_simple.jpg
--------------------------------------------------------------------------------
/images/moscowtime.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/moscowtime.jpg
--------------------------------------------------------------------------------
/images/moscowtime_simple.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/moscowtime_simple.jpg
--------------------------------------------------------------------------------
/images/pyblock.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/pyblock.jpg
--------------------------------------------------------------------------------
/images/search_widget.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/search_widget.jpg
--------------------------------------------------------------------------------
/images/supply.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cercatrova21/iOS_widgets/d991d3227a5aeed2aa260c1c403fd7b359f8a6d1/images/supply.jpg
--------------------------------------------------------------------------------