near_api 0.1.4 → 0.1.5

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: 1c8844d644d14d1d32fa4d27ef9247f0e5de59019dd195272a457b531935a416
4
- data.tar.gz: 3196cdfe44e96d18f997a67d8d55ec159c24158f3afdac7c3b30656a946bab34
3
+ metadata.gz: cc403c86a44e7bd759b4c71d8bf7499fbf5145c06d2a680811e2dea09fd1dada
4
+ data.tar.gz: b72df18eee4fec70ccc3f500255fa933a391b29606f564fd4264983369c81311
5
5
  SHA512:
6
- metadata.gz: 6d6d9e682ce1392ed9314d62340ea56e68fe81a48ed00bb8e981b950380613ea5f79b9df6c4ab3da7dd5a3e1cf5fe0c847ae6c6dcf7fd485b3a3e508a114ad76
7
- data.tar.gz: f89dfa4956871b176517e52cc868a26a9115aa6ae0beb1efbe634807f0e2d538e13d9cfbc56c81958bf948c1ce19b9ed3593da22439507950a1870004f4a7d26
6
+ metadata.gz: 3ba8d6c54f88f826e475105ff0bb64d59d57a35a0cdc3b196b69d43acddfcd3f9bbcd7af7eb6753704ca4b964f61fa13a0d21c280522de8f34fa55caad6cf2e4
7
+ data.tar.gz: 6d00755fa74f570b0acfbe51e64ca5e95c36b643a8c29509df0e6bcb0040de983ea638b319f927e1b9933581a551395257f56d11a92f3591b070ca330c6bbed6
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ class NearApi::Status
4
+ def initialize(config = NearApi.config)
5
+ @api = NearApi::Api.new(config)
6
+ end
7
+
8
+ def transaction_status(transaction_hash, key: NearApi.key)
9
+ params = [transaction_hash, key.signer_id]
10
+ call_api('tx', params)
11
+ end
12
+
13
+ def final_transaction_status(transaction_hash, key: NearApi.key)
14
+ params = [transaction_hash, key.signer_id]
15
+ call_api('EXPERIMENTAL_tx_status', params)
16
+ end
17
+
18
+ private
19
+
20
+ attr_reader :api
21
+
22
+ def call_api(method, params)
23
+ api.json_rpc(method, params)
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NearApi
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/near_api.rb CHANGED
@@ -3,14 +3,15 @@
3
3
  require 'uri'
4
4
  require 'net/https'
5
5
  require 'json'
6
- require "base64"
6
+ require 'base64'
7
7
  require 'borsh'
8
- require_relative "near_api/version"
9
- require_relative "near_api/key"
10
- require_relative "near_api/action"
8
+ require_relative 'near_api/version'
9
+ require_relative 'near_api/key'
10
+ require_relative 'near_api/status'
11
+ require_relative 'near_api/action'
11
12
  require_relative 'near_api/query'
12
- require_relative "near_api/action/function_call"
13
- require_relative "near_api/config"
13
+ require_relative 'near_api/action/function_call'
14
+ require_relative 'near_api/config'
14
15
  require_relative 'near_api/api'
15
16
  require_relative "near_api/base58"
16
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: near_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serg Tyatin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-22 00:00:00.000000000 Z
11
+ date: 2021-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: borsh-rb
@@ -89,6 +89,7 @@ files:
89
89
  - lib/near_api/config.rb
90
90
  - lib/near_api/key.rb
91
91
  - lib/near_api/query.rb
92
+ - lib/near_api/status.rb
92
93
  - lib/near_api/version.rb
93
94
  - near_api.gemspec
94
95
  homepage: https://github.com/2rba/near_api