evm-tx-input-decoder 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -4
- data/lib/evm_tx_input/decoder.rb +2 -2
- data/lib/evm_tx_input/version.rb +1 -1
- metadata +1 -2
- data/evm-tx-input-decoder.gemspec +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbb75e3f2b806c1db276550a62f5259e441bfd32206ff208f519246844818bc4
|
4
|
+
data.tar.gz: ac9a092eceddac159565df675c02be3e21fd7ab7bddc122c8ff4ad0c445cd048
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 643b121efe7f4c3bdd10ea4d9b71cf15c5e0f86135dd64595a427ef6c0a28da29616ba9cc5dee421b0bb162f2ea15f17e5e19bd0bfcde5107f11079c6bd8dcb2
|
7
|
+
data.tar.gz: 9f21802570d70eed97cc2fcb3a4b851a008a8552caaefd7d1d0285a0abbb8555e2d6b3199c063d74a8910802d19a82124173c2d3bfaaba1d20f101a78978d394
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -23,9 +23,10 @@ The input data is `0xa9059cbb00000000000000000000000003cb76e200ba785f6008c12933a
|
|
23
23
|
The USDT token ABI can be found by [this url](http://api.etherscan.io/api?module=contract&action=getabi&address=0xdac17f958d2ee523a2206206994597c13d831ec7&format=raw)
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
require '
|
26
|
+
require 'open-uri'
|
27
|
+
require 'evm_tx_input'
|
27
28
|
|
28
|
-
json = URI.open('http://api.etherscan.io/api?module=contract&action=getabi&address=0xdac17f958d2ee523a2206206994597c13d831ec7&format=raw') { |file|
|
29
|
+
json = URI.open('http://api.etherscan.io/api?module=contract&action=getabi&address=0xdac17f958d2ee523a2206206994597c13d831ec7&format=raw') { |file| file.read }
|
29
30
|
abi = JSON.parse(json)
|
30
31
|
input = '0xa9059cbb00000000000000000000000003cb76e200ba785f6008c12933aa3640536d2011000000000000000000000000000000000000000000000000000000a083712e00'
|
31
32
|
|
@@ -41,7 +42,7 @@ function.arguments
|
|
41
42
|
Following decoding procedure let's encode the previous result.
|
42
43
|
|
43
44
|
```ruby
|
44
|
-
require '
|
45
|
+
require 'evm_tx_input'
|
45
46
|
|
46
47
|
function_name = 'transfer'
|
47
48
|
types = %w[address uint256]
|
@@ -50,7 +51,7 @@ EvmTxInput::Encoder.encode_input(function_name, types, args)
|
|
50
51
|
#=> "0xa9059cbb00000000000000000000000003cb76e200ba785f6008c12933aa3640536d2011000000000000000000000000000000000000000000000000000000a083712e00"
|
51
52
|
```
|
52
53
|
|
53
|
-
For more details read the [documentation](https://rubydoc.info/github/rkotov93/evm-tx-input-decoder/main
|
54
|
+
For more details read the [documentation](https://rubydoc.info/github/rkotov93/evm-tx-input-decoder/main).
|
54
55
|
|
55
56
|
## Development
|
56
57
|
|
data/lib/evm_tx_input/decoder.rb
CHANGED
@@ -11,8 +11,8 @@ module EvmTxInput
|
|
11
11
|
|
12
12
|
# Constructor of EvmTxInput::Decoder
|
13
13
|
#
|
14
|
-
# @param abi [
|
15
|
-
def initialize(abi =
|
14
|
+
# @param abi [Array] parsed contract ABI
|
15
|
+
def initialize(abi = [])
|
16
16
|
@abi = abi
|
17
17
|
@method_definitions = method_definitions_by_id(abi)
|
18
18
|
end
|
data/lib/evm_tx_input/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evm-tx-input-decoder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruslan Kotov
|
@@ -40,7 +40,6 @@ files:
|
|
40
40
|
- LICENSE.txt
|
41
41
|
- README.md
|
42
42
|
- Rakefile
|
43
|
-
- evm-tx-input-decoder.gemspec
|
44
43
|
- lib/evm_tx_input.rb
|
45
44
|
- lib/evm_tx_input/argument.rb
|
46
45
|
- lib/evm_tx_input/decoder.rb
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'lib/evm_tx_input/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'evm-tx-input-decoder'
|
7
|
-
spec.version = EvmTxInput::VERSION
|
8
|
-
spec.authors = ['Ruslan Kotov']
|
9
|
-
spec.email = ['rkotov93@gmail.com']
|
10
|
-
|
11
|
-
spec.summary = 'Simple gem to decode and encode EVM transactions input data'
|
12
|
-
spec.description = 'This is a simple gem that helps decoding and encoding transactions input data'\
|
13
|
-
'for EVM based blockchains like Ethereum and Tron.'
|
14
|
-
spec.homepage = 'https://github.com/rkotov93/evm-tx-input-decoder'
|
15
|
-
spec.license = 'MIT'
|
16
|
-
spec.required_ruby_version = '>= 2.7.0'
|
17
|
-
|
18
|
-
# spec.metadata['allowed_push_host'] = "Set to your gem server 'https://example.com'"
|
19
|
-
|
20
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
21
|
-
spec.metadata['source_code_uri'] = 'https://github.com/rkotov93/evm-tx-input-decoder'
|
22
|
-
spec.metadata['changelog_uri'] = 'https://github.com/rkotov93/evm-tx-input-decoder/CHANGELOG.md'
|
23
|
-
|
24
|
-
# Specify which files should be added to the gem when it is released.
|
25
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
|
-
spec.files = Dir.chdir(__dir__) do
|
27
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
28
|
-
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
|
29
|
-
end
|
30
|
-
end
|
31
|
-
spec.bindir = 'exe'
|
32
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
33
|
-
spec.require_paths = %w[lib]
|
34
|
-
|
35
|
-
# Uncomment to register a new dependency of your gem
|
36
|
-
spec.add_dependency 'eth', '~> 0.5'
|
37
|
-
|
38
|
-
# For more information and examples about making a new gem, check out our
|
39
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
40
|
-
end
|