everscale-client-ruby 1.1.68 → 1.1.72

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: e8bdc1c27e392f348852e7f7f09b13e9df6280745ac763fc8afa03b376fce453
4
- data.tar.gz: c0e62fd12dcb8b88dbf8baf241f9d209fdd6d43d3843a19c2fcb0f59ca891ffa
3
+ metadata.gz: 136fc32e9f45062ce1d5438d556c62edc66e41af2d4af62536a472b40d34a94e
4
+ data.tar.gz: f224f11d2942876ae70e84760db488ec2236ee5066b7512c1c505feefed3e106
5
5
  SHA512:
6
- metadata.gz: 9be656b9ed66ded20e57ef9120d9d09eb279092142a36c7696e68b90283a8fcaaa9bcb0f63f8202f1c6db0fea04eeb464eab55ba77904f002ed8f7d22c11f4a5
7
- data.tar.gz: a427ab508894e999aa2aaff388ce2480df47fbd7a718bfa18ff6c9a8c2354d6f37821c4a636a381c6e1aff666420c810162a8f416835f1f6538306207603fd34
6
+ metadata.gz: 8fc44736ed3251e6a1d1df9bb8a278afe642ffc4c10c8f3912f01b4b73ea7cafb2fc30eaac033c64880db0d2fa411dcca10fe7095e5dd9fca182f252f6a0ec2f
7
+ data.tar.gz: 83867a9d7aaebdff3f8ebe2feccd2e3c19625d901c5d76288c6c95ebf3f6f16c1f6cb41bad07e4c4a4830217b757c0b5c2b4f437361195ddfd97831c19a1bd42
@@ -40,6 +40,7 @@ elsif ARGV[0] == 'setup'
40
40
  unless Dir.exist?("#{GEM_DIR}/TON-SDK")
41
41
  system("cd #{GEM_DIR} && git clone https://github.com/tonlabs/TON-SDK ./TON-SDK")
42
42
  end
43
+ system("cd #{GEM_DIR}/TON-SDK && git reset --hard HEAD")
43
44
  system("cd #{GEM_DIR}/TON-SDK && git pull --ff-only")
44
45
  system("cd #{GEM_DIR}/TON-SDK && cargo update")
45
46
  system("cd #{GEM_DIR}/TON-SDK && cargo build --release")
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.42.1",
2
+ "version": "1.44.0",
3
3
  "modules": [
4
4
  {
5
5
  "name": "client",
@@ -395,7 +395,7 @@
395
395
  }
396
396
  },
397
397
  "summary": "List of Evernode endpoints.",
398
- "description": "Any correct URL format can be specified, including IP addresses. This parameter is prevailing over `server_address`.\nCheck the full list of [supported network endpoints](https://docs.everos.dev/ever-sdk/reference/ever-os-api/networks)."
398
+ "description": "Any correct URL format can be specified, including IP addresses. This parameter is prevailing over `server_address`.\nCheck the full list of [supported network endpoints](https://docs.evercloud.dev/products/evercloud/networks-endpoints)."
399
399
  },
400
400
  {
401
401
  "name": "network_retries_count",
@@ -471,8 +471,8 @@
471
471
  "number_type": "UInt",
472
472
  "number_size": 32
473
473
  },
474
- "summary": "Maximum time difference between server and client.",
475
- "description": "If client's device time is out of sync and difference is more than the threshold then error will occur. Also an error will occur if the specified threshold is more than\n`message_processing_timeout/2`.\n\nMust be specified in milliseconds. Default is 15000 (15 sec)."
474
+ "summary": "**DEPRECATED**: This parameter was deprecated.",
475
+ "description": null
476
476
  },
477
477
  {
478
478
  "name": "sending_endpoint_count",
@@ -681,8 +681,8 @@
681
681
  "number_type": "UInt",
682
682
  "number_size": 32
683
683
  },
684
- "summary": "Message lifetime for contracts which ABI includes \"expire\" header. The default value is 40 sec.",
685
- "description": null
684
+ "summary": "Message lifetime for contracts which ABI includes \"expire\" header.",
685
+ "description": "Must be specified in milliseconds. Default is 40000 (40 sec)."
686
686
  },
687
687
  {
688
688
  "name": "message_expiration_timeout_grow_factor",
@@ -692,8 +692,8 @@
692
692
  "number_type": "Float",
693
693
  "number_size": 32
694
694
  },
695
- "summary": "Factor that increases the expiration timeout for each retry The default value is 1.5",
696
- "description": null
695
+ "summary": "Factor that increases the expiration timeout for each retry",
696
+ "description": "Default is 1.5"
697
697
  }
698
698
  ],
699
699
  "summary": null,
@@ -5644,8 +5644,8 @@
5644
5644
  "number_type": "UInt",
5645
5645
  "number_size": 32
5646
5646
  },
5647
- "summary": "Message expiration time in seconds. If not specified - calculated automatically from message_expiration_timeout(), try_index and message_expiration_timeout_grow_factor() (if ABI includes `expire` header).",
5648
- "description": null
5647
+ "summary": "Message expiration timestamp (UNIX time) in seconds.",
5648
+ "description": "If not specified - calculated automatically from message_expiration_timeout(),\ntry_index and message_expiration_timeout_grow_factor() (if ABI includes `expire` header)."
5649
5649
  },
5650
5650
  {
5651
5651
  "name": "time",
@@ -5711,8 +5711,29 @@
5711
5711
  "struct_fields": [
5712
5712
  {
5713
5713
  "name": "tvc",
5714
- "type": "String",
5715
- "summary": "Content of TVC file encoded in `base64`.",
5714
+ "type": "Optional",
5715
+ "optional_inner": {
5716
+ "type": "String"
5717
+ },
5718
+ "summary": "Content of TVC file encoded in `base64`. For compatibility reason this field can contain an encoded `StateInit`.",
5719
+ "description": null
5720
+ },
5721
+ {
5722
+ "name": "code",
5723
+ "type": "Optional",
5724
+ "optional_inner": {
5725
+ "type": "String"
5726
+ },
5727
+ "summary": "Contract code BOC encoded with base64.",
5728
+ "description": null
5729
+ },
5730
+ {
5731
+ "name": "state_init",
5732
+ "type": "Optional",
5733
+ "optional_inner": {
5734
+ "type": "String"
5735
+ },
5736
+ "summary": "State init BOC encoded with base64.",
5716
5737
  "description": null
5717
5738
  },
5718
5739
  {
@@ -7962,6 +7983,146 @@
7962
7983
  "summary": null,
7963
7984
  "description": null
7964
7985
  },
7986
+ {
7987
+ "name": "BuilderOp",
7988
+ "type": "EnumOfTypes",
7989
+ "enum_types": [
7990
+ {
7991
+ "name": "Integer",
7992
+ "type": "Struct",
7993
+ "struct_fields": [
7994
+ {
7995
+ "name": "size",
7996
+ "type": "Number",
7997
+ "number_type": "UInt",
7998
+ "number_size": 32,
7999
+ "summary": "Bit size of the value.",
8000
+ "description": null
8001
+ },
8002
+ {
8003
+ "name": "value",
8004
+ "type": "Ref",
8005
+ "ref_name": "Value",
8006
+ "summary": "Value: - `Number` containing integer number.",
8007
+ "description": "e.g. `123`, `-123`. - Decimal string. e.g. `\"123\"`, `\"-123\"`.\n- `0x` prefixed hexadecimal string.\n e.g `0x123`, `0X123`, `-0x123`."
8008
+ }
8009
+ ],
8010
+ "summary": "Append integer to cell data.",
8011
+ "description": null
8012
+ },
8013
+ {
8014
+ "name": "BitString",
8015
+ "type": "Struct",
8016
+ "struct_fields": [
8017
+ {
8018
+ "name": "value",
8019
+ "type": "String",
8020
+ "summary": "Bit string content using bitstring notation. See `TON VM specification` 1.0.",
8021
+ "description": "Contains hexadecimal string representation:\n- Can end with `_` tag.\n- Can be prefixed with `x` or `X`.\n- Can be prefixed with `x{` or `X{` and ended with `}`.\n\nContains binary string represented as a sequence\nof `0` and `1` prefixed with `n` or `N`.\n\nExamples:\n`1AB`, `x1ab`, `X1AB`, `x{1abc}`, `X{1ABC}`\n`2D9_`, `x2D9_`, `X2D9_`, `x{2D9_}`, `X{2D9_}`\n`n00101101100`, `N00101101100`"
8022
+ }
8023
+ ],
8024
+ "summary": "Append bit string to cell data.",
8025
+ "description": null
8026
+ },
8027
+ {
8028
+ "name": "Cell",
8029
+ "type": "Struct",
8030
+ "struct_fields": [
8031
+ {
8032
+ "name": "builder",
8033
+ "type": "Array",
8034
+ "array_item": {
8035
+ "type": "Ref",
8036
+ "ref_name": "boc.BuilderOp"
8037
+ },
8038
+ "summary": "Nested cell builder.",
8039
+ "description": null
8040
+ }
8041
+ ],
8042
+ "summary": "Append ref to nested cells.",
8043
+ "description": null
8044
+ },
8045
+ {
8046
+ "name": "CellBoc",
8047
+ "type": "Struct",
8048
+ "struct_fields": [
8049
+ {
8050
+ "name": "boc",
8051
+ "type": "String",
8052
+ "summary": "Nested cell BOC encoded with `base64` or BOC cache key.",
8053
+ "description": null
8054
+ }
8055
+ ],
8056
+ "summary": "Append ref to nested cell.",
8057
+ "description": null
8058
+ },
8059
+ {
8060
+ "name": "Address",
8061
+ "type": "Struct",
8062
+ "struct_fields": [
8063
+ {
8064
+ "name": "address",
8065
+ "type": "String",
8066
+ "summary": "Address in a common `workchain:account` or base64 format.",
8067
+ "description": null
8068
+ }
8069
+ ],
8070
+ "summary": "Address.",
8071
+ "description": null
8072
+ }
8073
+ ],
8074
+ "summary": "Cell builder operation.",
8075
+ "description": null
8076
+ },
8077
+ {
8078
+ "name": "Tvc",
8079
+ "type": "EnumOfTypes",
8080
+ "enum_types": [
8081
+ {
8082
+ "name": "V1",
8083
+ "type": "Struct",
8084
+ "struct_fields": [
8085
+ {
8086
+ "name": "value",
8087
+ "type": "Ref",
8088
+ "ref_name": "boc.TvcV1",
8089
+ "summary": null,
8090
+ "description": null
8091
+ }
8092
+ ],
8093
+ "summary": null,
8094
+ "description": null
8095
+ }
8096
+ ],
8097
+ "summary": null,
8098
+ "description": null
8099
+ },
8100
+ {
8101
+ "name": "TvcV1",
8102
+ "type": "Struct",
8103
+ "struct_fields": [
8104
+ {
8105
+ "name": "code",
8106
+ "type": "Optional",
8107
+ "optional_inner": {
8108
+ "type": "String"
8109
+ },
8110
+ "summary": null,
8111
+ "description": null
8112
+ },
8113
+ {
8114
+ "name": "description",
8115
+ "type": "Optional",
8116
+ "optional_inner": {
8117
+ "type": "String"
8118
+ },
8119
+ "summary": null,
8120
+ "description": null
8121
+ }
8122
+ ],
8123
+ "summary": null,
8124
+ "description": null
8125
+ },
7965
8126
  {
7966
8127
  "name": "BocErrorCode",
7967
8128
  "type": "EnumOfConsts",
@@ -8019,6 +8180,35 @@
8019
8180
  "summary": null,
8020
8181
  "description": null
8021
8182
  },
8183
+ {
8184
+ "name": "ParamsOfDecodeTvc",
8185
+ "type": "Struct",
8186
+ "struct_fields": [
8187
+ {
8188
+ "name": "tvc",
8189
+ "type": "String",
8190
+ "summary": "Contract TVC BOC encoded as base64 or BOC handle",
8191
+ "description": null
8192
+ }
8193
+ ],
8194
+ "summary": null,
8195
+ "description": null
8196
+ },
8197
+ {
8198
+ "name": "ResultOfDecodeTvc",
8199
+ "type": "Struct",
8200
+ "struct_fields": [
8201
+ {
8202
+ "name": "tvc",
8203
+ "type": "Ref",
8204
+ "ref_name": "boc.Tvc",
8205
+ "summary": "Decoded TVC",
8206
+ "description": null
8207
+ }
8208
+ ],
8209
+ "summary": null,
8210
+ "description": null
8211
+ },
8022
8212
  {
8023
8213
  "name": "ParamsOfParse",
8024
8214
  "type": "Struct",
@@ -8279,97 +8469,6 @@
8279
8469
  "summary": null,
8280
8470
  "description": null
8281
8471
  },
8282
- {
8283
- "name": "BuilderOp",
8284
- "type": "EnumOfTypes",
8285
- "enum_types": [
8286
- {
8287
- "name": "Integer",
8288
- "type": "Struct",
8289
- "struct_fields": [
8290
- {
8291
- "name": "size",
8292
- "type": "Number",
8293
- "number_type": "UInt",
8294
- "number_size": 32,
8295
- "summary": "Bit size of the value.",
8296
- "description": null
8297
- },
8298
- {
8299
- "name": "value",
8300
- "type": "Ref",
8301
- "ref_name": "Value",
8302
- "summary": "Value: - `Number` containing integer number.",
8303
- "description": "e.g. `123`, `-123`. - Decimal string. e.g. `\"123\"`, `\"-123\"`.\n- `0x` prefixed hexadecimal string.\n e.g `0x123`, `0X123`, `-0x123`."
8304
- }
8305
- ],
8306
- "summary": "Append integer to cell data.",
8307
- "description": null
8308
- },
8309
- {
8310
- "name": "BitString",
8311
- "type": "Struct",
8312
- "struct_fields": [
8313
- {
8314
- "name": "value",
8315
- "type": "String",
8316
- "summary": "Bit string content using bitstring notation. See `TON VM specification` 1.0.",
8317
- "description": "Contains hexadecimal string representation:\n- Can end with `_` tag.\n- Can be prefixed with `x` or `X`.\n- Can be prefixed with `x{` or `X{` and ended with `}`.\n\nContains binary string represented as a sequence\nof `0` and `1` prefixed with `n` or `N`.\n\nExamples:\n`1AB`, `x1ab`, `X1AB`, `x{1abc}`, `X{1ABC}`\n`2D9_`, `x2D9_`, `X2D9_`, `x{2D9_}`, `X{2D9_}`\n`n00101101100`, `N00101101100`"
8318
- }
8319
- ],
8320
- "summary": "Append bit string to cell data.",
8321
- "description": null
8322
- },
8323
- {
8324
- "name": "Cell",
8325
- "type": "Struct",
8326
- "struct_fields": [
8327
- {
8328
- "name": "builder",
8329
- "type": "Array",
8330
- "array_item": {
8331
- "type": "Ref",
8332
- "ref_name": "boc.BuilderOp"
8333
- },
8334
- "summary": "Nested cell builder.",
8335
- "description": null
8336
- }
8337
- ],
8338
- "summary": "Append ref to nested cells.",
8339
- "description": null
8340
- },
8341
- {
8342
- "name": "CellBoc",
8343
- "type": "Struct",
8344
- "struct_fields": [
8345
- {
8346
- "name": "boc",
8347
- "type": "String",
8348
- "summary": "Nested cell BOC encoded with `base64` or BOC cache key.",
8349
- "description": null
8350
- }
8351
- ],
8352
- "summary": "Append ref to nested cell.",
8353
- "description": null
8354
- },
8355
- {
8356
- "name": "Address",
8357
- "type": "Struct",
8358
- "struct_fields": [
8359
- {
8360
- "name": "address",
8361
- "type": "String",
8362
- "summary": "Address in a common `workchain:account` or base64 format.",
8363
- "description": null
8364
- }
8365
- ],
8366
- "summary": "Address.",
8367
- "description": null
8368
- }
8369
- ],
8370
- "summary": "Cell builder operation.",
8371
- "description": null
8372
- },
8373
8472
  {
8374
8473
  "name": "ParamsOfEncodeBoc",
8375
8474
  "type": "Struct",
@@ -8498,13 +8597,13 @@
8498
8597
  "description": null
8499
8598
  },
8500
8599
  {
8501
- "name": "ParamsOfDecodeTvc",
8600
+ "name": "ParamsOfDecodeStateInit",
8502
8601
  "type": "Struct",
8503
8602
  "struct_fields": [
8504
8603
  {
8505
- "name": "tvc",
8604
+ "name": "state_init",
8506
8605
  "type": "String",
8507
- "summary": "Contract TVC image BOC encoded as base64 or BOC handle",
8606
+ "summary": "Contract StateInit image BOC encoded as base64 or BOC handle",
8508
8607
  "description": null
8509
8608
  },
8510
8609
  {
@@ -8522,7 +8621,7 @@
8522
8621
  "description": null
8523
8622
  },
8524
8623
  {
8525
- "name": "ResultOfDecodeTvc",
8624
+ "name": "ResultOfDecodeStateInit",
8526
8625
  "type": "Struct",
8527
8626
  "struct_fields": [
8528
8627
  {
@@ -8635,7 +8734,7 @@
8635
8734
  "description": null
8636
8735
  },
8637
8736
  {
8638
- "name": "ParamsOfEncodeTvc",
8737
+ "name": "ParamsOfEncodeStateInit",
8639
8738
  "type": "Struct",
8640
8739
  "struct_fields": [
8641
8740
  {
@@ -8709,13 +8808,13 @@
8709
8808
  "description": null
8710
8809
  },
8711
8810
  {
8712
- "name": "ResultOfEncodeTvc",
8811
+ "name": "ResultOfEncodeStateInit",
8713
8812
  "type": "Struct",
8714
8813
  "struct_fields": [
8715
8814
  {
8716
- "name": "tvc",
8815
+ "name": "state_init",
8717
8816
  "type": "String",
8718
- "summary": "Contract TVC image BOC encoded as base64 or BOC handle of boc_cache parameter was specified",
8817
+ "summary": "Contract StateInit image BOC encoded as base64 or BOC handle of boc_cache parameter was specified",
8719
8818
  "description": null
8720
8819
  }
8721
8820
  ],
@@ -8826,6 +8925,44 @@
8826
8925
  }
8827
8926
  ],
8828
8927
  "functions": [
8928
+ {
8929
+ "name": "decode_tvc",
8930
+ "summary": "Decodes tvc according to the tvc spec. Read more about tvc structure here https://github.com/tonlabs/ever-struct/blob/main/src/scheme/mod.rs#L30",
8931
+ "description": null,
8932
+ "params": [
8933
+ {
8934
+ "name": "context",
8935
+ "type": "Generic",
8936
+ "generic_name": "Arc",
8937
+ "generic_args": [
8938
+ {
8939
+ "type": "Ref",
8940
+ "ref_name": "ClientContext"
8941
+ }
8942
+ ],
8943
+ "summary": null,
8944
+ "description": null
8945
+ },
8946
+ {
8947
+ "name": "params",
8948
+ "type": "Ref",
8949
+ "ref_name": "boc.ParamsOfDecodeTvc",
8950
+ "summary": null,
8951
+ "description": null
8952
+ }
8953
+ ],
8954
+ "result": {
8955
+ "type": "Generic",
8956
+ "generic_name": "ClientResult",
8957
+ "generic_args": [
8958
+ {
8959
+ "type": "Ref",
8960
+ "ref_name": "boc.ResultOfDecodeTvc"
8961
+ }
8962
+ ]
8963
+ },
8964
+ "errors": null
8965
+ },
8829
8966
  {
8830
8967
  "name": "parse_message",
8831
8968
  "summary": "Parses message boc into a JSON",
@@ -9396,8 +9533,8 @@
9396
9533
  "errors": null
9397
9534
  },
9398
9535
  {
9399
- "name": "decode_tvc",
9400
- "summary": "Decodes tvc into code, data, libraries and special options.",
9536
+ "name": "decode_state_init",
9537
+ "summary": "Decodes contract's initial state into code, data, libraries and special options.",
9401
9538
  "description": null,
9402
9539
  "params": [
9403
9540
  {
@@ -9416,7 +9553,7 @@
9416
9553
  {
9417
9554
  "name": "params",
9418
9555
  "type": "Ref",
9419
- "ref_name": "boc.ParamsOfDecodeTvc",
9556
+ "ref_name": "boc.ParamsOfDecodeStateInit",
9420
9557
  "summary": null,
9421
9558
  "description": null
9422
9559
  }
@@ -9427,15 +9564,15 @@
9427
9564
  "generic_args": [
9428
9565
  {
9429
9566
  "type": "Ref",
9430
- "ref_name": "boc.ResultOfDecodeTvc"
9567
+ "ref_name": "boc.ResultOfDecodeStateInit"
9431
9568
  }
9432
9569
  ]
9433
9570
  },
9434
9571
  "errors": null
9435
9572
  },
9436
9573
  {
9437
- "name": "encode_tvc",
9438
- "summary": "Encodes tvc from code, data, libraries ans special options (see input params)",
9574
+ "name": "encode_state_init",
9575
+ "summary": "Encodes initial contract state from code, data, libraries ans special options (see input params)",
9439
9576
  "description": null,
9440
9577
  "params": [
9441
9578
  {
@@ -9454,7 +9591,7 @@
9454
9591
  {
9455
9592
  "name": "params",
9456
9593
  "type": "Ref",
9457
- "ref_name": "boc.ParamsOfEncodeTvc",
9594
+ "ref_name": "boc.ParamsOfEncodeStateInit",
9458
9595
  "summary": null,
9459
9596
  "description": null
9460
9597
  }
@@ -9465,7 +9602,7 @@
9465
9602
  "generic_args": [
9466
9603
  {
9467
9604
  "type": "Ref",
9468
- "ref_name": "boc.ResultOfEncodeTvc"
9605
+ "ref_name": "boc.ResultOfEncodeStateInit"
9469
9606
  }
9470
9607
  ]
9471
9608
  },
@@ -11609,6 +11746,13 @@
11609
11746
  "value": "414",
11610
11747
  "summary": null,
11611
11748
  "description": null
11749
+ },
11750
+ {
11751
+ "name": "AccountIsSuspended",
11752
+ "type": "Number",
11753
+ "value": "415",
11754
+ "summary": null,
11755
+ "description": null
11612
11756
  }
11613
11757
  ],
11614
11758
  "summary": null,
@@ -43,7 +43,7 @@ class CodeGenerator
43
43
  def generateReadme(types)
44
44
  readmePath = root_dir + "/README.md"
45
45
  content = %{
46
- # Ruby Client for Free TON SDK
46
+ # Ruby Client for TVM SDK Toncoin, Everscale, Venom, Gosh
47
47
 
48
48
  <p align="center">
49
49
  <a href="https://github.com/venom-blockchain/developer-program">
@@ -54,6 +54,11 @@ class CodeGenerator
54
54
  [![GEM](https://img.shields.io/badge/ruby-gem-orange)](https://rubygems.org/gems/everscale-client-ruby)
55
55
  [![SPM](https://img.shields.io/badge/SDK%20VERSION-#{types.version}-green)](https://github.com/tonlabs/TON-SDK)
56
56
 
57
+ ## Get api keys and TVM endpoints:
58
+
59
+ You need to get an API-KEY here [https://dashboard.evercloud.dev](https://dashboard.evercloud.dev)
60
+
61
+
57
62
  ## Install
58
63
 
59
64
  Install gem
@@ -62,12 +67,13 @@ gem install everscale-client-ruby
62
67
  ```
63
68
 
64
69
  Install TON-SDK
70
+
71
+ ##### result - path to dylib file for everscale-client-ruby configuration
65
72
  ```bash
66
73
  everscale-client-ruby setup
67
- # result - path to dylib file for everscale-client-ruby configuration
68
74
  ```
69
75
 
70
- ### Manual build FreeTON SDK
76
+ ### Manual build TVM SDK
71
77
  0. Install Rust to your OS
72
78
  1. git clone https://github.com/tonlabs/ever-sdk
73
79
  2. cd ./ever-sdk
@@ -82,7 +88,7 @@ TonClient.configure { |config| config.ffi_lib(./ever-sdk/target/release/libton_c
82
88
  # For Linux
83
89
  # TonClient.configure { |config| config.ffi_lib(./ever-sdk/target/release/libton_client.so) }
84
90
 
85
- client = TonClient.create(config: {network: {endpoints: ["https://eri01.net.everos.dev", "https://rbx01.net.everos.dev"]}})
91
+ client = TonClient.create(config: {network: {endpoints: ["https://eri01.net.everos.dev/YOUR-X-API-KEY", "https://rbx01.net.everos.dev/YOUR-X-API-KEY"]}})
86
92
 
87
93
  # All methods are asynchronous
88
94
 
@@ -183,12 +183,12 @@ module TonClient
183
183
 
184
184
  request_id = request_id.increment
185
185
  requests[request_id] = block
186
- # p "start #{request_id}"
186
+ # p "start id #{request_id} - requests #{requests.object_id}"
187
187
  tc_request(context, method_name_string, payload_string, request_id) do |request_id, string_data, response_type, finished|
188
- # p "tc_request #{request_id}"
189
- # p "Thread.current #{Thread.current}"
188
+ # p "rust inside id #{request_id} - #{method_name}"
190
189
  begin
191
- monitor.synchronize do
190
+ monitor&.synchronize do
191
+ # p "request_id #{request_id}, monitor #{monitor.object_id} - requests #{requests.object_id}"
192
192
  request = requests[request_id]
193
193
  if request
194
194
  request.call(Response.new(request_id, string_data, response_type, finished))
@@ -13,6 +13,20 @@ module TonClient
13
13
  @monitor = monitor
14
14
  end
15
15
 
16
+ # INPUT: ParamsOfDecodeTvc
17
+ # tvc: String - # # Contract TVC BOC encoded as base64 or BOC handle
18
+ # RESPONSE: ResultOfDecodeTvc
19
+ # tvc: Tvc - # # Decoded TVC
20
+ # Async
21
+ def decode_tvc(payload, &block)
22
+ TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
23
+ end
24
+
25
+ # Sync
26
+ def decode_tvc_sync(payload)
27
+ TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
28
+ end
29
+
16
30
  # INPUT: ParamsOfParse
17
31
  # boc: String - # # BOC encoded as base64
18
32
  # RESPONSE: ResultOfParse
@@ -229,10 +243,10 @@ module TonClient
229
243
  TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
230
244
  end
231
245
 
232
- # INPUT: ParamsOfDecodeTvc
233
- # tvc: String - # # Contract TVC image BOC encoded as base64 or BOC handle
246
+ # INPUT: ParamsOfDecodeStateInit
247
+ # state_init: String - # # Contract StateInit image BOC encoded as base64 or BOC handle
234
248
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided.
235
- # RESPONSE: ResultOfDecodeTvc
249
+ # RESPONSE: ResultOfDecodeStateInit
236
250
  # code: String<Optional> - # # Contract code BOC encoded as base64 or BOC handle
237
251
  # code_hash: String<Optional> - # # Contract code hash
238
252
  # code_depth: Number<Optional> - # # Contract code depth
@@ -245,16 +259,16 @@ module TonClient
245
259
  # split_depth: Number<Optional> - # # Is present and non-zero only in instances of large smart contracts
246
260
  # compiler_version: String<Optional> - # # Compiler version, for example 'sol 0.49.0'
247
261
  # Async
248
- def decode_tvc(payload, &block)
262
+ def decode_state_init(payload, &block)
249
263
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
250
264
  end
251
265
 
252
266
  # Sync
253
- def decode_tvc_sync(payload)
267
+ def decode_state_init_sync(payload)
254
268
  TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
255
269
  end
256
270
 
257
- # INPUT: ParamsOfEncodeTvc
271
+ # INPUT: ParamsOfEncodeStateInit
258
272
  # code: String<Optional> - # # Contract code BOC encoded as base64 or BOC handle
259
273
  # data: String<Optional> - # # Contract data BOC encoded as base64 or BOC handle
260
274
  # library: String<Optional> - # # Contract library BOC encoded as base64 or BOC handle
@@ -262,15 +276,15 @@ module TonClient
262
276
  # tock: Boolean<Optional> - # # `special.tock` field. # # Specifies the contract ability to handle tock transactions
263
277
  # split_depth: Number<Optional> - # # Is present and non-zero only in instances of large smart contracts
264
278
  # boc_cache: BocCacheType<Optional> - # # Cache type to put the result. The BOC itself returned if no cache type provided.
265
- # RESPONSE: ResultOfEncodeTvc
266
- # tvc: String - # # Contract TVC image BOC encoded as base64 or BOC handle of boc_cache parameter was specified
279
+ # RESPONSE: ResultOfEncodeStateInit
280
+ # state_init: String - # # Contract StateInit image BOC encoded as base64 or BOC handle of boc_cache parameter was specified
267
281
  # Async
268
- def encode_tvc(payload, &block)
282
+ def encode_state_init(payload, &block)
269
283
  TonBinding.requestLibrary(context: context, request_id: request_id, requests: requests, monitor: monitor, method_name: full_method_name(MODULE, __method__.to_s), payload: payload, &block)
270
284
  end
271
285
 
272
286
  # Sync
273
- def encode_tvc_sync(payload)
287
+ def encode_state_init_sync(payload)
274
288
  TonBinding.send_request_sync(context: context, method_name: full_method_name(MODULE, __method__.to_s).sub(/_sync$/, ''), payload: payload)
275
289
  end
276
290
 
@@ -15,13 +15,23 @@ module TonClient
15
15
 
16
16
  def self.callLibraryMethodSync(method, *args)
17
17
  responses = []
18
- queue = Queue.new
18
+ mutex = Monitor.new
19
+ condition = mutex.new_cond
20
+
19
21
  method.call(*args) do |response|
20
- responses << response
21
- yield(responses) if block_given?
22
- queue.push 1 if response.finished == true
22
+ mutex.synchronize do
23
+ responses << response
24
+ if response.finished == true
25
+ condition.signal
26
+ end
27
+ end
23
28
  end
24
- queue.pop
29
+
30
+ mutex.synchronize do
31
+ condition.wait
32
+ end
33
+
34
+ yield(responses.map{ |resp| resp if resp.result }.compact) if block_given?
25
35
  end
26
36
 
27
37
  class RequestId
@@ -1,4 +1,4 @@
1
1
  module TonClient
2
- VERSION = "1.1.68"
2
+ VERSION = "1.1.72"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: everscale-client-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.68
4
+ version: 1.1.72
5
5
  platform: ruby
6
6
  authors:
7
7
  - nerzh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-29 00:00:00.000000000 Z
11
+ date: 2023-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubygems_version: 3.4.12
145
+ rubygems_version: 3.4.16
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: This is gem everscale-client-ruby