klaytn 0.0.2 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed4fcb0b9e08db6917b1894cb830e6e1defe8d60ee36abab18eba1b115867cbf
4
- data.tar.gz: 696c31b090e503f89fa591371aff141558ed1fab96455602602897a524a5d45d
3
+ metadata.gz: eb463244b3eebbe9e9d4d78b1390aa403ff599f54e4fb720009263a7b0bde1a2
4
+ data.tar.gz: c51c6117e83f0f1caa493c3444587915687cc8c6dde0744ed9198ed26bd81369
5
5
  SHA512:
6
- metadata.gz: d15ee526048fc2241de2137ff7cb615975f9f3766de53298a54259f63a5dac24d1c52d7f6f4dbdc500f150ed8144c84adc8d8168a6bcada89f19a21c41f259d4
7
- data.tar.gz: 51ea4334ed61229920b3881af2ed3ef3dffd024aaadddc51eb8f96bfed3f1cdece6df4bc9e50d5cac07891e953bb4dc049347009fc7e96934d46d8739708eccc
6
+ metadata.gz: 6b321a639aa4072de550ab6130940b1582f214eb580f664d40fccaf4f6c658d66ec3e2c0756e3853675341c3d946604cb339f80d32a50e275b895caaf9f6c264
7
+ data.tar.gz: 0d18c944f4b65721789af743d9afd36980e1315502344fecfd7bcf5bd843397b5ea63aae9765a3429cf6922d4d78f13b75d553ac0dae9b00da481f96346f9ef5
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Klaytn Ruby Library
2
- Execute transactions and interact with smart contracts, wallets, and NFT tokens on the Klaytn blockchain (https://www.klaytn.com/). Most functions require KAS Console credentials and KLAY tokens (inside a KAS Account Pool wallet) to pay transaction fees. Created by [ooju.xyz](https://ooju.xyz).
2
+ Execute transactions and interact with smart contracts, wallets, and NFT tokens on the [Klaytn blockchain](https://www.klaytn.com/). Most functions require KAS Console credentials and KLAY tokens (inside a KAS Account Pool wallet) to pay transaction fees. Created by [ooju.xyz](https://ooju.xyz).
3
3
 
4
4
  ## Installation
5
5
 
@@ -21,7 +21,7 @@ Or install it yourself as:
21
21
  This library is modeled off the [KAS Wallet API](https://refs.klaytnapi.com/en/wallet/latest), but is not an exhaustive implementation. Below are the core features.
22
22
 
23
23
  **Client authentication**
24
- ```
24
+ ```rb
25
25
  opts = {
26
26
  kas_access_key: 'KASxxx',
27
27
  kas_secret_access_key: 'yyy',
@@ -32,7 +32,7 @@ opts = {
32
32
  ```
33
33
 
34
34
  **Transactions**
35
- ```
35
+ ```rb
36
36
  client = Klaytn::Transaction.new(opts)
37
37
 
38
38
  # fetch a transaction
@@ -43,7 +43,7 @@ result = client.send('0x00E7b604e9493d53749e7b7b9e39F313d9F9890a', 1, { memo: 's
43
43
  ```
44
44
 
45
45
  **Wallets**
46
- ```
46
+ ```rb
47
47
  client = Klaytn::Wallet.new # no authentication required
48
48
 
49
49
  # get a wallet
@@ -54,7 +54,7 @@ result = client.get_balance('0x00e7b604e9493d53749e7b7b9e39f313d9f9890a') # => 3
54
54
  ```
55
55
 
56
56
  **Tokens**
57
- ```
57
+ ```rb
58
58
  # instantiation requires additional params
59
59
  opts = opts.merge(contract_address: '0xbceaa2fa50fef79bb5c4b2fc887dbdd3b96130b7')
60
60
  client = Klaytn::Token.new(opts)
@@ -64,15 +64,15 @@ result = client.get(1) # => {"tokenId"=>"0x1", "owner"=>"0x58e0cc86..."}
64
64
  ```
65
65
 
66
66
  **Contracts**
67
- ```
67
+ ```rb
68
68
  # deploy a contract
69
69
  client = Klaytn::Contract.new(opts)
70
- result = client.deploy(bytecode) # => {"from"=>"0x6e1f42c1e..."}
70
+ result = client.deploy('<bytecode>') # => {"from"=>"0x6e1f42c1e..."}
71
71
 
72
- # interact with a contract
72
+ # interact with a deployed contract
73
73
  opts = opts.merge(
74
- abi: [{...}], # deployed contract ABI
75
- contract_address: '0xbceaa2fa50fef79bb5c4b2fc887dbdd3b96130b7' # deployed contract address
74
+ abi: [{...}],
75
+ contract_address: '0xbceaa2fa50fef79bb5c4b2fc887dbdd3b96130b7'
76
76
  )
77
77
  client = Klaytn::Contract.new(opts)
78
78
  result = client.invoke_function('addAddressToWhitelist', ['0x00E7b604e9493d53749e7b7b9e39F313d9F9890a']) # => {"from"=>"0x3f71cde4246cb..."}
data/klaytn.gemspec CHANGED
@@ -12,7 +12,11 @@ Gem::Specification.new do |spec|
12
12
  spec.license = "MIT"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
14
 
15
- # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
15
+ if spec.respond_to?(:metadata)
16
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
17
+ else
18
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
19
+ end
16
20
 
17
21
  spec.metadata["homepage_uri"] = spec.homepage
18
22
  spec.metadata["source_code_uri"] = "https://github.com/OojuTeam/klaytn-ruby"
@@ -25,9 +29,9 @@ Gem::Specification.new do |spec|
25
29
  end
26
30
  spec.bindir = "exe"
27
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
32
+ spec.require_paths = ["lib", "bin"]
29
33
 
30
34
  spec.add_development_dependency "rspec", "~> 3.9.1"
31
- spec.add_development_dependency "httparty", "~> 0.17.0"
32
- spec.add_development_dependency "ethereum.rb", "~> 2.5"
35
+ spec.add_dependency "httparty", "~> 0.17.0"
36
+ spec.add_dependency "ethereum.rb", "~> 2.5"
33
37
  end
@@ -1,3 +1,3 @@
1
1
  module Klaytn
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klaytn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Kulp
@@ -32,7 +32,7 @@ dependencies:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: 0.17.0
35
- type: :development
35
+ type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
@@ -46,7 +46,7 @@ dependencies:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
48
  version: '2.5'
49
- type: :development
49
+ type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
@@ -87,6 +87,7 @@ homepage: https://github.com/OojuTeam/klaytn-ruby
87
87
  licenses:
88
88
  - MIT
89
89
  metadata:
90
+ allowed_push_host: https://rubygems.org
90
91
  homepage_uri: https://github.com/OojuTeam/klaytn-ruby
91
92
  source_code_uri: https://github.com/OojuTeam/klaytn-ruby
92
93
  changelog_uri: https://github.com/usefomo/fomo-ruby-sdk/releases
@@ -94,6 +95,7 @@ post_install_message:
94
95
  rdoc_options: []
95
96
  require_paths:
96
97
  - lib
98
+ - bin
97
99
  required_ruby_version: !ruby/object:Gem::Requirement
98
100
  requirements:
99
101
  - - ">="