ethscribe 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09ac9a5eb1dbb35dde2105a3865bf6c67edd5469e8f9518e46949752f127991a'
4
- data.tar.gz: 81e37a9c8a75bf4b1ec7a7ac82feccee8906a4a45636c750f7ba54e8c3797334
3
+ metadata.gz: 54c1bc99feba882f271fdf9e1158cf47c09e4611664d3d2d27fc770e2d3e4882
4
+ data.tar.gz: 5a0297d9ccb9df224707b34101803a262f21bb63bf2e2debb963913296654551
5
5
  SHA512:
6
- metadata.gz: 5cc33bb70781c8490fb1f5c8c3512f22d614fa6eade666d90ec7c1e7e30a77559e42a77f0bbaa28518111b1b1b0da498c764b9627d31488e0aab3d7788919f3b
7
- data.tar.gz: 73547597a38a756b3be3dcf8d11ee387e651dffdfea3db936f250a146288bdc74b5a7f2d575e1a9eccce9e21b1b204591e4df8436601656f35780866a29afa06
6
+ metadata.gz: 3bd5ff76a13b14e43ad80ba4ba742e19bfebf13491f4ad77ec6feeaac636ec8d0b1c90f749e7371812df1e186813a1885001b682ec4ca9ed40acc13bebc41656
7
+ data.tar.gz: a8477a3ff5e4ced79055b3292f2731eb9088976ddaea275e2fbc8bf23809ea4bbbf8bc52dec9be6014b41cab58038bcb5ac3d9dc301c7be99281625c87e5e21d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,4 @@
1
+ ### 1.0.0
1
2
  ### 0.2.0
2
3
  ### 0.0.1 / 2023-11-20
3
4
 
data/README.md CHANGED
@@ -4,8 +4,8 @@ ethscribe - inscription / inscribe (ethscription calldata) api wrapper & helpe
4
4
 
5
5
 
6
6
 
7
- * home :: [github.com/s6ruby/rubidity](https://github.com/s6ruby/rubidity)
8
- * bugs :: [github.com/s6ruby/rubidity/issues](https://github.com/s6ruby/rubidity/issues)
7
+ * home :: [github.com/0xCompute/ethscribe](https://github.com/0xCompute/ethscribe)
8
+ * bugs :: [github.com/0xCompute/ethscribe/issues](https://github.com/0xCompute/ethscribe/issues)
9
9
  * gem :: [rubygems.org/gems/ethscribe](https://rubygems.org/gems/ethscribe)
10
10
  * rdoc :: [rubydoc.info/gems/ethscribe](http://rubydoc.info/gems/ethscribe)
11
11
 
@@ -47,52 +47,52 @@ Let's try the mainnet:
47
47
  ```ruby
48
48
  require 'ethscribe'
49
49
 
50
- web = Ethscribe::Api.mainnet # or Ethscribe::Api.goerli
50
+ net = Ethscribe::Api.mainnet # or Ethscribe::Api.goerli
51
51
 
52
52
 
53
- ## get latest 25 inscriptions (defaults: page_size=25, sort_order=desc)
54
- pp web.ethscriptions
53
+ # get latest 25 inscriptions (defaults: page_size=25, sort_order=desc)
54
+ pp net.ethscriptions
55
55
 
56
- ## get inscriptions page 1 (same as above)
57
- pp web.ethscriptions( page: 1 )
56
+ # get inscriptions page 1 (same as above)
57
+ pp net.ethscriptions( page: 1 )
58
58
 
59
59
  # get inscriptions page 2
60
- pp web.ethscriptions( page: 2 )
60
+ pp net.ethscriptions( page: 2 )
61
61
 
62
62
  # get oldest first - sort_order=asc
63
- pp web.ethscriptions( page: 1, sort_order: 'asc' )
64
- pp web.ethscriptions( page: 2, sort_order: 'asc' )
63
+ pp net.ethscriptions( page: 1, sort_order: 'asc' )
64
+ pp net.ethscriptions( page: 2, sort_order: 'asc' )
65
65
 
66
66
 
67
67
  # get inscription by id or num
68
- pp web.ethscription( 0 )
69
- pp web.ethscription( 1 )
70
- pp web.ethscription( 1000 )
71
- pp web.ethscription( 1_000_000 )
68
+ pp net.ethscription( 0 )
69
+ pp net.ethscription( 1 )
70
+ pp net.ethscription( 1000 )
71
+ pp net.ethscription( 1_000_000 )
72
72
 
73
73
 
74
- # get inscriptions owend by <addresss>
74
+ # get inscriptions owned by <addresss>
75
75
  address = '0x2a878245b52a2d46cb4327541cbc96e403a84791'
76
- pp web.ethscriptions_owned_by( address )
76
+ pp net.ethscriptions_owned_by( address )
77
77
 
78
78
 
79
79
  # get inscription (decoded) content_data and content_type by id or num
80
- pp web.ethscription_data( 0 )
81
- pp web.ethscription_data( 1 )
82
- pp web.ethscription_data( 2 )
80
+ pp net.ethscription_data( 0 )
81
+ pp net.ethscription_data( 1 )
82
+ pp net.ethscription_data( 2 )
83
83
 
84
84
 
85
85
  # check if content exists (using sha256 hash)
86
86
  # inscribe no. 0
87
87
  sha = '2817fd9cf901e4435253881550731a5edc5e519c19de46b08e2b19a18e95143e'
88
- pp web.ethscription_exists( sha )
88
+ pp net.ethscription_exists( sha )
89
89
 
90
90
  # inscribe no. ??
91
91
  sha = '2817fd9cf901e4435253833550731a5edc5e519c19de46b08e2b19a18e95143e'
92
- pp web.ethscription_exists( sha )
92
+ pp net.ethscription_exists( sha )
93
93
 
94
94
  # check the indexer (block) status
95
- pp web.block_status
95
+ pp net.block_status
96
96
  ```
97
97
 
98
98
 
@@ -108,7 +108,9 @@ at the ruby code commons (rubycocos) org.
108
108
 
109
109
  ## Questions? Comments?
110
110
 
111
- Join us in the [Rubidity (community) discord (chat server)](https://discord.gg/3JRnDUap6y). Yes you can.
111
+ Join us in the [0xCompute discord (chat server)](https://discord.gg/3JRnDUap6y)
112
+ (or in the more general Ethscription discord).
113
+ Yes you can.
112
114
  Your questions and commentary welcome.
113
115
 
114
116
  Or post them over at the [Help & Support](https://github.com/geraldb/help) page. Thanks.
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ Hoe.spec 'ethscribe' do
8
8
  self.summary = 'ethscribe - inscription / inscribe (ethscription calldata) api wrapper & helpers for Ethereum & co.'
9
9
  self.description = summary
10
10
 
11
- self.urls = { home: 'https://github.com/s6ruby/rubidity' }
11
+ self.urls = { home: 'https://github.com/0xCompute/ethscribe' }
12
12
 
13
13
  self.author = 'Gerald Bauer'
14
14
  self.email = 'gerald.bauer@gmail.com'
data/lib/ethscribe/api.rb CHANGED
@@ -45,13 +45,67 @@ class Api ## change/rename Api to Client - why? why not?
45
45
  params << ['sort_order', sort_order.to_s.downcase ] if sort_order
46
46
 
47
47
  if params.size > 0
48
- src += "?" + params.map { |key,value| "#{key}=#{value}" }.join('&')
48
+ src += "?" + params.map { |key,value| "#{key}=#{URI.encode_uri_component(value)}" }.join('&')
49
49
  end
50
50
 
51
51
  res = get( src )
52
52
  res.json ## return parsed json data - why? why not?
53
53
  end
54
54
 
55
+
56
+ ####
57
+ # ContractTransaction.transaction_mimetype
58
+ # "application/vnd.facet.tx+json"
59
+ # SystemConfigVersion.system_mimetype
60
+ # "application/vnd.facet.system+json"
61
+ def newer_facet_txs( new_block_number,
62
+ max: 2500,
63
+ max_blocks: 10000,
64
+ count: 0 )
65
+ newer_ethscriptions( new_block_number,
66
+ max_ethscriptions: max,
67
+ max_blocks: max_blocks,
68
+ mimetypes: ['application/vnd.facet.tx+json',
69
+ 'application/vnd.facet.system+json'],
70
+ count: count
71
+ )
72
+ end
73
+ alias_method :newer_facet_txns, :newer_facet_txs
74
+
75
+ ## add "undocumented" endpoint
76
+ ## /ethscriptions/newer_ethscriptions
77
+ ##
78
+ ## see https://github.com/0xFacet/facet-vm/blob/main/app/models/ethscription_sync.rb
79
+
80
+ def newer_ethscriptions( new_block_number,
81
+ max_ethscriptions: 2500,
82
+ max_blocks: 10000,
83
+ mimetypes: [],
84
+ count: 0
85
+ )
86
+ src = "#{@base}/ethscriptions/newer_ethscriptions"
87
+
88
+ params = []
89
+ params << ['block_number', new_block_number.to_s]
90
+
91
+ ## note: array MUST use rails convention with []
92
+ mimetypes.each do |mimetype|
93
+ params << ['mimetypes[]', mimetype]
94
+ end
95
+
96
+ params << ['max_ethscriptions', max_ethscriptions.to_s]
97
+ params << ['max_blocks', max_blocks.to_s ]
98
+ params << ['past_ethscriptions_count', count.to_s]
99
+
100
+ src += "?" + params.map do |key,value|
101
+ "#{URI.encode_uri_component(key)}=#{URI.encode_uri_component(value)}"
102
+ end.join('&')
103
+
104
+ res = get( src )
105
+ res.json ## return parsed json data - why? why not?
106
+ end
107
+
108
+
55
109
  #
56
110
  # Get ethscriptions owned by address
57
111
  #
@@ -1,7 +1,7 @@
1
1
 
2
2
  module Ethscribe
3
- MAJOR = 0 ## todo: namespace inside version or something - why? why not??
4
- MINOR = 2
3
+ MAJOR = 1 ## todo: namespace inside version or something - why? why not??
4
+ MINOR = 0
5
5
  PATCH = 0
6
6
  VERSION = [MAJOR,MINOR,PATCH].join('.')
7
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ethscribe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-21 00:00:00.000000000 Z
11
+ date: 2024-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocos
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '4.0'
53
+ version: '4.1'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '4.0'
60
+ version: '4.1'
61
61
  description: ethscribe - inscription / inscribe (ethscription calldata) api wrapper
62
62
  & helpers for Ethereum & co.
63
63
  email: gerald.bauer@gmail.com
@@ -75,7 +75,7 @@ files:
75
75
  - lib/ethscribe.rb
76
76
  - lib/ethscribe/api.rb
77
77
  - lib/ethscribe/version.rb
78
- homepage: https://github.com/s6ruby/rubidity
78
+ homepage: https://github.com/0xCompute/ethscribe
79
79
  licenses:
80
80
  - Public Domain
81
81
  metadata: {}