near_api 0.2.3 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0178927f06a7b596da0c8080f4893136fc151fea0c554bc98c6875e69e5ce989'
4
- data.tar.gz: 8b2767b1c427ebe6028efa2337088aa7513d53fad440afac6ec6e7e53acb6be7
3
+ metadata.gz: e1b94b217159dc9e689e1608c1f72c0d626418a6aaa71ec48be30cb38ce132f8
4
+ data.tar.gz: d0723e5fe8c9f55e8f3c284d2de2a1398c0df06b478b09b45d291849d1f4d24f
5
5
  SHA512:
6
- metadata.gz: 202b1e0c31d69c5c49eb95b57d78fdec369b01a28e8f5d963b4b18acdcd9d790c24983663e4dd94c695ca63d029657a8be13dc0a2511e44d5cd1e95fe7263a43
7
- data.tar.gz: ca770893644ba4aa94c1c5b857aa0363b8e66c7e2b655a2b326d05261dde96025a1089c1f3036eb737bbe272d8f3528a8648dae291cb45d4edd40b641982bb6c
6
+ metadata.gz: 6fd97f233fa84796cf260fb56e46f8207cd5e9791076d9b8244d3031ecea1f8d53972b5c52a494892798fb7d898508b01cbaee4800ad6800beeaddd048d0c8c3
7
+ data.tar.gz: c079748efc12a9064594e964c5da76c9aa4ec08b86d680061b8fa126374dbaf08d2671fc3e7e671cde9228e31316e40b12e68cc79ed6687c4b3cffd74e97d40e
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Change Log
2
+
3
+ ## 0.3.1
4
+ - removed NearApi::Status#final_transaction_status method
5
+ - added NearApi::Status#transaction_status_with_receipts method
6
+ - updated NearApi::Status#transaction_status arguments
@@ -1,17 +1,42 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class NearApi::Status
4
+ STATUSES = [
5
+ # Transaction is waiting to be included into the block
6
+ NONE = 'NONE',
7
+
8
+ # Transaction is included into the block. The block may be not finalized yet
9
+ INCLUDED = 'INCLUDED',
10
+
11
+ # Transaction is included into the block +
12
+ # All non-refund transaction receipts finished their execution.
13
+ # The corresponding blocks for tx and each receipt may be not finalized yet
14
+ EXECUTED_OPTIMISTIC = 'EXECUTED_OPTIMISTIC',
15
+
16
+ # Transaction is included into finalized block
17
+ INCLUDED_FINAL = 'INCLUDED_FINAL',
18
+
19
+ # Transaction is included into finalized block +
20
+ # All non-refund transaction receipts finished their execution.
21
+ # The corresponding blocks for each receipt may be not finalized yet
22
+ EXECUTED = 'EXECUTED',
23
+
24
+ # Transaction is included into finalized block +
25
+ # Execution of all transaction receipts is finalized, including refund receipts
26
+ FINAL = 'FINAL'
27
+ ].freeze
28
+
4
29
  def initialize(config = NearApi.config)
5
30
  @api = NearApi::Api.new(config)
6
31
  end
7
32
 
8
- def transaction_status(transaction_hash, key: NearApi.key)
9
- params = [transaction_hash, key.signer_id]
33
+ def transaction_status(transaction_hash, wait_until: EXECUTED_OPTIMISTIC, key: NearApi.key)
34
+ params = { tx_hash: transaction_hash, sender_account_id: key.signer_id, wait_until: wait_until }
10
35
  call_api('tx', params)
11
36
  end
12
37
 
13
- def final_transaction_status(transaction_hash, key: NearApi.key)
14
- params = [transaction_hash, key.signer_id]
38
+ def transaction_status_with_receipts(transaction_hash, wait_until: EXECUTED_OPTIMISTIC, key: NearApi.key)
39
+ params = { tx_hash: transaction_hash, sender_account_id: key.signer_id, wait_until: wait_until }
15
40
  call_api('EXPERIMENTAL_tx_status', params)
16
41
  end
17
42
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NearApi
4
- VERSION = '0.2.3'
4
+ VERSION = '0.3.1'
5
5
  end
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.2.3
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serg Tyatin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-26 00:00:00.000000000 Z
11
+ date: 2024-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: borsh-rb
@@ -76,6 +76,7 @@ files:
76
76
  - ".github/workflows/ci.yml"
77
77
  - ".gitignore"
78
78
  - ".rspec"
79
+ - CHANGELOG.md
79
80
  - Gemfile
80
81
  - LICENSE.txt
81
82
  - README.md