ordinals 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +86 -3
  3. data/Rakefile +1 -1
  4. data/lib/ordinals.rb +10 -2
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99bcfe173a347fb795174d2fc8a38ed2e8bde67089ae0340edda7c146592107c
4
- data.tar.gz: e916e620469af7171250c630e09fbeb8c223eb9e197643e109127d07eed27519
3
+ metadata.gz: a7a362c24bda8951706799ad74ddd75b148b94353166d4bf807b2b929ec1c1a1
4
+ data.tar.gz: ee12466f380d678b7f652a33a4035fb66e593ece071d5489777abf121c1fbef7
5
5
  SHA512:
6
- metadata.gz: d15fc49964cfe2473a23ce61f36bed070d31e722afcb2110dfa33e0452f68ec6653a668b986c17924f0ce7b9ad20d9e8c63f594d4622dc2feb72641352b25f3e
7
- data.tar.gz: 421f3eec03fd8cddbd290edae6eaec5a3d37b1448ce3736242fb58a28f0802c6fea6eea0d2ab49b635957aee103ebb5d9bc010830d947ac849f77a2e1ddf0ab4
6
+ metadata.gz: 73cf537fef77274ef1a6acb568fe2a516bec3c4cf3eeceef32e51e8e43df27cbf8236d304897b957a462f1946466db2b38d79969d5ad9228e917a99d32189c4b
7
+ data.tar.gz: f45716b1e22dcdc42542e5972c1df9635272af900187ce61796d9cf5916a785c65d9c8bca74943733d069b80d7f3acaed78e231820a9a58ad806d31387cb7470
data/README.md CHANGED
@@ -12,9 +12,92 @@ ordinals gem - ordinals (inscription) api wrapper & helpers for Bitcoin, Litcoin
12
12
  ## Usage
13
13
 
14
14
 
15
-
16
-
17
-
15
+ For now ordinal inscription api queries are supported on
16
+ - Bitcoin (via <https://ordinals.com>)
17
+ - Litecoin (via <https://litecoin.earlyordies.com>) and
18
+ - Dogecoin (via <https://doginals.com>)
19
+
20
+
21
+ Let's start querying for bitcoin (btc) ordinal inscriptions:
22
+
23
+ ``` ruby
24
+ require 'ordinals'
25
+
26
+
27
+ # get the inscription binary blob / data by id
28
+ # e.g. GET https://ordinals.com/content/c41021cb11dce003e6a20a3420cf5954a1d104a1fe314393b915a62f020dcd0ai0...
29
+
30
+ id = 'c41021cb11dce003e6a20a3420cf5954a1d104a1fe314393b915a62f020dcd0ai0'
31
+ content = Ordinals.content( id )
32
+ pp content
33
+ #=> #<Ordinals::Api::Content:0x000001a1352df938
34
+ # @data="RIFF\xF8\v\x00\x00WEBPVP8 \xEC\v\x00\x00...",
35
+ # @length=3072,
36
+ # @type="image/png">
37
+
38
+ # get the inscription meta data by id
39
+ # e.g. https://ordinals.com/inscription/c41021cb11dce003e6a20a3420cf5954a1d104a1fe314393b915a62f020dcd0ai0...
40
+ data = Ordinals.inscription( id )
41
+ pp data
42
+ #=> {"title"=>"Inscription 133993",
43
+ # "id"=>"c41021cb11dce003e6a20a3420cf5954a1d104a1fe314393b915a62f020dcd0ai0",
44
+ # "address"=>"bc1pyncs638hxfhaqjvnedw2lyc2jta6zuvr9erj6m9cwlghp6qqwvhqeq574l",
45
+ # "output value"=>"9667",
46
+ # "sat"=>"1391087135005306",
47
+ # "preview"=>"link",
48
+ # "content"=>"link",
49
+ # "content length"=>"3072 bytes",
50
+ # "content type"=>"image/png",
51
+ # "timestamp"=>"2023-02-18 03:02:18 UTC",
52
+ # "genesis height"=>"777099",
53
+ # "genesis fee"=>"1814",
54
+ # "genesis transaction"=>"c41021cb11dce003e6a20a3420cf5954a1d104a1fe314393b915a62f020dcd0a",
55
+ # "location"=>"6a57dedb854c9bcac3fd2daab1172dd9a45f24c366dd8db33fe80557f11c6b39:22:0",
56
+ # "output"=>"6a57dedb854c9bcac3fd2daab1172dd9a45f24c366dd8db33fe80557f11c6b39:22",
57
+ # "offset"=>"0"}
58
+ ```
59
+
60
+
61
+ Let's try querying for litecoin (ltc) ordinal inscriptions:
62
+
63
+ ``` ruby
64
+ Ordinals.chain = :ltc
65
+
66
+
67
+ # get the inscription binary blob / data by id
68
+ # e.g. GET https://litecoin.earlyordies.com/inscription/f2b6adf7b2d0f128fb14817ff37f5f36e9176b17571e20c49871875553f937b4i0...
69
+
70
+ id = 'f2b6adf7b2d0f128fb14817ff37f5f36e9176b17571e20c49871875553f937b4i0'
71
+ content = Ordinals.content( id )
72
+ pp content
73
+ #=> #<Ordinals::Api::Content:0x000001a1357fd6e0
74
+ # @data="\x89PNG\r\n\x1A\n\x00\x00\x00...",
75
+ # @length=816,
76
+ # @type="image/png">
77
+
78
+
79
+ # get the inscription meta data by id
80
+ # e.g GET https://litecoin.earlyordies.com/inscription/f2b6adf7b2d0f128fb14817ff37f5f36e9176b17571e20c49871875553f937b4i0...
81
+ data = Ordinals.inscription( id )
82
+ pp data
83
+ #=> {"title"=>"Inscription 642",
84
+ # "id"=>"f2b6adf7b2d0f128fb14817ff37f5f36e9176b17571e20c49871875553f937b4i0",
85
+ # "address"=>"LSDz4fM4mLFyAZVoDuKyMHYq3af6cSZGSY",
86
+ # "output value"=>"9878",
87
+ # "preview"=>"link",
88
+ # "content"=>"link",
89
+ # "content length"=>"816 bytes",
90
+ # "content type"=>"image/png",
91
+ # "timestamp"=>"2023-02-21 05:29:33 UTC",
92
+ # "genesis height"=>"2426201",
93
+ # "genesis fee"=>"361",
94
+ # "genesis transaction"=>"f2b6adf7b2d0f128fb14817ff37f5f36e9176b17571e20c49871875553f937b4",
95
+ # "location"=>"6802c71b49f18aab91d0b363762b24afb1bf00c4820a5f782de6dd1b1cfbd68a:0:0",
96
+ # "output"=>"6802c71b49f18aab91d0b363762b24afb1bf00c4820a5f782de6dd1b1cfbd68a:0",
97
+ # "offset"=>"0"}
98
+ ```
99
+
100
+ That's it for now.
18
101
 
19
102
 
20
103
 
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ end
10
10
 
11
11
  Hoe.spec 'ordinals' do
12
12
 
13
- self.version = '1.0.1'
13
+ self.version = '1.0.2'
14
14
 
15
15
  self.summary = 'ordinals gem - ordinals (inscription) api wrapper & helpers for Bitcoin, Litecoin, Dogecoin & co.'
16
16
  self.description = summary
data/lib/ordinals.rb CHANGED
@@ -54,8 +54,10 @@ module Ordinals
54
54
  def self.config() @config ||= Configuration.new; end
55
55
 
56
56
  ## add some convenience shortcut helpers (no config. required) - why? why not?
57
- def self.client() config.client; end
58
- def self.chain() config.chain; end
57
+ def self.client() config.client; end
58
+ def self.chain() config.chain; end
59
+ def self.chain=(value) config.chain = value; end
60
+
59
61
 
60
62
  def self.btc?() config.chain == 'btc'; end
61
63
  def self.ltc?() config.chain == 'ltc'; end
@@ -70,6 +72,12 @@ module Ordinals
70
72
  alias_method :dogecoin?, :doge?
71
73
  alias_method :dogecon?, :doge?
72
74
  end
75
+
76
+
77
+ ###################
78
+ ### more convenience shortcuts
79
+ def self.inscription( id ) client.inscription( id ); end
80
+ def self.content( id ) client.content( id ); end
73
81
  end # module Ordinals
74
82
 
75
83
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ordinals
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer