near_api 0.3.1 → 0.4.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: e1b94b217159dc9e689e1608c1f72c0d626418a6aaa71ec48be30cb38ce132f8
4
- data.tar.gz: d0723e5fe8c9f55e8f3c284d2de2a1398c0df06b478b09b45d291849d1f4d24f
3
+ metadata.gz: a142f691dbf68db8700b6e48684f97e8d9106126b56aea18543750f359e56058
4
+ data.tar.gz: 2a33e90389472f591fe1517e09546bd8172740d6867951381769c72398381302
5
5
  SHA512:
6
- metadata.gz: 6fd97f233fa84796cf260fb56e46f8207cd5e9791076d9b8244d3031ecea1f8d53972b5c52a494892798fb7d898508b01cbaee4800ad6800beeaddd048d0c8c3
7
- data.tar.gz: c079748efc12a9064594e964c5da76c9aa4ec08b86d680061b8fa126374dbaf08d2671fc3e7e671cde9228e31316e40b12e68cc79ed6687c4b3cffd74e97d40e
6
+ metadata.gz: d4509b0f43f7de4f2f01944dd901c23c2f1594d09ef797e0e3c6a3aaf8dfcd1722d4c5d6c5541e1bbed37dfdc37d3b7143f76451374df79d5fc14d38e37d2f2c
7
+ data.tar.gz: 89b0cfc6ada035f32ac3bc633ec2cfb07d0212844de46e5715ef48e92b241d880e29bb4e1b5ef4218ed7d1b4363936a6d0e866d23a2aadf13d69a78fcf9f5ac7
data/CHANGELOG.md CHANGED
@@ -4,3 +4,7 @@
4
4
  - removed NearApi::Status#final_transaction_status method
5
5
  - added NearApi::Status#transaction_status_with_receipts method
6
6
  - updated NearApi::Status#transaction_status arguments
7
+
8
+ ## 0.4.1
9
+ - refactor NearApi::Transaction, replace deprecated `broadcast_tx_async` with `send_tx`
10
+ - breaking change NearApi::Transaction#call_api arguments
@@ -27,14 +27,9 @@ module NearApi
27
27
  @api = NearApi::Api.new(config)
28
28
  end
29
29
 
30
- def call
30
+ def call(wait_until: Status::EXECUTED_OPTIMISTIC)
31
31
  signature = key.sign(message.digest)
32
- call_api('broadcast_tx_commit', message.message, signature)
33
- end
34
-
35
- def async
36
- signature = key.sign(message.digest)
37
- call_api('broadcast_tx_async', message.message, signature)
32
+ call_api(message.message, signature, wait_until: wait_until)
38
33
  end
39
34
 
40
35
  def message
@@ -48,9 +43,10 @@ module NearApi
48
43
  NearApi::Base58.encode(message.digest)
49
44
  end
50
45
 
51
- def call_api(method, message, signature)
46
+ def call_api(message, signature, wait_until: Status::EXECUTED_OPTIMISTIC)
52
47
  signed_transaction = message + Borsh::Integer.new(key.key_type, :u8).to_borsh + signature
53
- api.json_rpc(method, [Base64.strict_encode64(signed_transaction)])
48
+ params = { signed_tx_base64: Base64.strict_encode64(signed_transaction), wait_until: wait_until }
49
+ api.json_rpc('send_tx', params)
54
50
  end
55
51
 
56
52
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NearApi
4
- VERSION = '0.3.1'
4
+ VERSION = '0.4.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.3.1
4
+ version: 0.4.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-08-06 00:00:00.000000000 Z
11
+ date: 2024-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: borsh-rb