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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/near_api/transaction.rb +5 -9
- data/lib/near_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a142f691dbf68db8700b6e48684f97e8d9106126b56aea18543750f359e56058
|
4
|
+
data.tar.gz: 2a33e90389472f591fe1517e09546bd8172740d6867951381769c72398381302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/near_api/transaction.rb
CHANGED
@@ -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(
|
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(
|
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
|
-
|
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
|
data/lib/near_api/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: borsh-rb
|