diff --git a/Readme.md b/Readme.md index dad75f5..3bbe2eb 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ # TON SDK client Golang -[![EVER-SDK](https://img.shields.io/badge/EVER_SDK-1.39.0-green.svg)](https://github.com/tonlabs/EVER-SDK/tree/1.39.0) +[![EVER-SDK](https://img.shields.io/badge/EVER_SDK-1.40.0-green.svg)](https://github.com/tonlabs/EVER-SDK/tree/1.40.0) [![TON local-node docker image](https://img.shields.io/badge/TON_local_node-0.33.0-green.svg)](https://hub.docker.com/layers/local-node/tonlabs/local-node/0.33.0/images/sha256-40a544432089f2d730f3dd0542fcb59bef6c5192b5d374fdae3a7ea6417070c4) [![Chat Telegram](https://img.shields.io/badge/chat-Telegram-9cf.svg)](https://t.me/RADIANCE_EVER_SDK) [![Documentation](https://godoc.org/github.com/radianceteam/everscale-client-go/client?status.svg)](https://godoc.org/github.com/radianceteam/everscale-client-go/client) diff --git a/api-spec.json b/api-spec.json index d717e2c..a46c1a6 100644 --- a/api-spec.json +++ b/api-spec.json @@ -1,5 +1,5 @@ { - "version": "1.39.0", + "version": "1.40.0", "modules": [ { "name": "client", @@ -254,6 +254,13 @@ "value": "35", "summary": null, "description": null + }, + { + "name": "InvalidData", + "type": "Number", + "value": "36", + "summary": null, + "description": null } ], "summary": null, @@ -7126,6 +7133,47 @@ ], "summary": null, "description": null + }, + { + "name": "ParamsOfGetSignatureData", + "type": "Struct", + "struct_fields": [ + { + "name": "abi", + "type": "Ref", + "ref_name": "abi.Abi", + "summary": "Contract ABI used to decode.", + "description": null + }, + { + "name": "message", + "type": "String", + "summary": "Message BOC encoded in `base64`.", + "description": null + } + ], + "summary": null, + "description": null + }, + { + "name": "ResultOfGetSignatureData", + "type": "Struct", + "struct_fields": [ + { + "name": "signature", + "type": "String", + "summary": "Signature from the message in `hex`.", + "description": null + }, + { + "name": "hash", + "type": "String", + "summary": "Hash to verify the signature in `base64`.", + "description": null + } + ], + "summary": null, + "description": null } ], "functions": [ @@ -7698,6 +7746,44 @@ ] }, "errors": null + }, + { + "name": "get_signature_data", + "summary": "Extracts signature from message body and calculates hash to verify the signature", + "description": null, + "params": [ + { + "name": "context", + "type": "Generic", + "generic_name": "Arc", + "generic_args": [ + { + "type": "Ref", + "ref_name": "ClientContext" + } + ], + "summary": null, + "description": null + }, + { + "name": "params", + "type": "Ref", + "ref_name": "abi.ParamsOfGetSignatureData", + "summary": null, + "description": null + } + ], + "result": { + "type": "Generic", + "generic_name": "ClientResult", + "generic_args": [ + { + "type": "Ref", + "ref_name": "abi.ResultOfGetSignatureData" + } + ] + }, + "errors": null } ] }, diff --git a/client/mod_abi.gen.go b/client/mod_abi.gen.go index 8e02e75..e6ccbff 100644 --- a/client/mod_abi.gen.go +++ b/client/mod_abi.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod abi // @@ -782,6 +782,20 @@ type ResultOfCalcFunctionId struct { FunctionID uint32 `json:"function_id"` } +type ParamsOfGetSignatureData struct { + // Contract ABI used to decode. + Abi Abi `json:"abi"` + // Message BOC encoded in `base64`. + Message string `json:"message"` +} + +type ResultOfGetSignatureData struct { + // Signature from the message in `hex`. + Signature string `json:"signature"` + // Hash to verify the signature in `base64`. + Hash string `json:"hash"` +} + // Encodes message body according to ABI function call. func (c *Client) AbiEncodeMessageBody(p *ParamsOfEncodeMessageBody) (*ResultOfEncodeMessageBody, error) { result := new(ResultOfEncodeMessageBody) @@ -979,3 +993,12 @@ func (c *Client) AbiCalcFunctionId(p *ParamsOfCalcFunctionId) (*ResultOfCalcFunc return result, err } + +// Extracts signature from message body and calculates hash to verify the signature. +func (c *Client) AbiGetSignatureData(p *ParamsOfGetSignatureData) (*ResultOfGetSignatureData, error) { + result := new(ResultOfGetSignatureData) + + err := c.dllClient.waitErrorOrResultUnmarshal("abi.get_signature_data", p, result) + + return result, err +} diff --git a/client/mod_boc.gen.go b/client/mod_boc.gen.go index 154e8b4..4b4e0cc 100644 --- a/client/mod_boc.gen.go +++ b/client/mod_boc.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod boc // diff --git a/client/mod_client.gen.go b/client/mod_client.gen.go index cea7c37..ffe95cb 100644 --- a/client/mod_client.gen.go +++ b/client/mod_client.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod client // @@ -49,6 +49,7 @@ const ( InternalErrorErrorCode = 33 InvalidHandleErrorCode = 34 LocalStorageErrorErrorCode = 35 + InvalidDataErrorCode = 36 ) func init() { // nolint gochecknoinits @@ -87,6 +88,7 @@ func init() { // nolint gochecknoinits errorCodesToErrorTypes[InternalErrorErrorCode] = "InternalErrorErrorCode" errorCodesToErrorTypes[InvalidHandleErrorCode] = "InvalidHandleErrorCode" errorCodesToErrorTypes[LocalStorageErrorErrorCode] = "LocalStorageErrorErrorCode" + errorCodesToErrorTypes[InvalidDataErrorCode] = "InvalidDataErrorCode" } type Error struct { diff --git a/client/mod_crypto.gen.go b/client/mod_crypto.gen.go index 653695a..a3d0aee 100644 --- a/client/mod_crypto.gen.go +++ b/client/mod_crypto.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod crypto // diff --git a/client/mod_debot.gen.go b/client/mod_debot.gen.go index e89e142..1bf39ec 100644 --- a/client/mod_debot.gen.go +++ b/client/mod_debot.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod debot // diff --git a/client/mod_net.gen.go b/client/mod_net.gen.go index 7c522e1..17676a8 100644 --- a/client/mod_net.gen.go +++ b/client/mod_net.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod net // diff --git a/client/mod_processing.gen.go b/client/mod_processing.gen.go index 69aef30..80e17ef 100644 --- a/client/mod_processing.gen.go +++ b/client/mod_processing.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod processing // diff --git a/client/mod_proofs.gen.go b/client/mod_proofs.gen.go index 30df4ab..d782909 100644 --- a/client/mod_proofs.gen.go +++ b/client/mod_proofs.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod proofs // diff --git a/client/mod_tvm.gen.go b/client/mod_tvm.gen.go index 878fbf8..0f0fc15 100644 --- a/client/mod_tvm.gen.go +++ b/client/mod_tvm.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod tvm // diff --git a/client/mod_utils.gen.go b/client/mod_utils.gen.go index 1191bf4..f472ef0 100644 --- a/client/mod_utils.gen.go +++ b/client/mod_utils.gen.go @@ -1,6 +1,6 @@ package client -// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Dec 22 11:48 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 28 Jan 23 13:55 UTC // // Mod utils //