klaytn 0.0.2 → 0.0.3
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/README.md +10 -10
- data/lib/klaytn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 840690260a6ceff31a91ffe9cacc0c409250ffad205f19fbbe1be530a10ebdf0
|
4
|
+
data.tar.gz: e4a52cab25d3fcd889bcc17ebd128a06d9abe4c3df3cccd19cfbd4084cad6a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9ea5ea41989f1edeed62f3f19b6548d2ecbf2b3ba4a01ef417285705ba0961652f9310852c090402f36ca0512f99ac8079848e37f11f3d3f9af2218234b26ec
|
7
|
+
data.tar.gz: 2cf0539ca0bc93703130122d440daca05d46d13ab67843d3a494aa8f76b4343170f5a101dfc30cd0752b59195b08a402e197799f6579fcb356de247459437290
|
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
|
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: [{...}],
|
75
|
-
contract_address: '0xbceaa2fa50fef79bb5c4b2fc887dbdd3b96130b7'
|
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/lib/klaytn/version.rb
CHANGED