Skip to content

Commit

Permalink
[1.19.0-rc] Add support for TON-SDK 1.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
risentveber committed Jul 10, 2021
1 parent 046397c commit 072ea8a
Show file tree
Hide file tree
Showing 11 changed files with 259 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TON SDK client Golang

[![TON-SDK](https://img.shields.io/badge/TON_SDK-1.17.0-green.svg)](https://github.com/tonlabs/TON-SDK/tree/1.17.0)
[![TON-SDK](https://img.shields.io/badge/TON_SDK-1.19.0-green.svg)](https://github.com/tonlabs/TON-SDK/tree/1.19.0)
[![TON local-node docker image](https://img.shields.io/badge/TON_local_node-0.28.3-green.svg)](https://hub.docker.com/layers/tonlabs/local-node/0.28.3/images/sha256-d4c9b11b9a811602423c44f3529d81cb91fa13bf45617d81a6ca8e057fce1506)
[![Chat Telegram](https://img.shields.io/badge/chat-Telegram-9cf.svg)](https://t.me/RADIANCE_TON_SDK)
[![Documentation](https://godoc.org/github.com/radianceteam/ton-client-go/client?status.svg)](https://godoc.org/github.com/radianceteam/ton-client-go/client)
Expand Down
189 changes: 188 additions & 1 deletion api-spec.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.18.0",
"version": "1.19.0",
"modules": [
{
"name": "client",
Expand Down Expand Up @@ -4248,6 +4248,13 @@
"value": "312",
"summary": null,
"description": null
},
{
"name": "InvalidData",
"type": "Number",
"value": "313",
"summary": null,
"description": null
}
],
"summary": null,
Expand Down Expand Up @@ -4914,6 +4921,19 @@
},
"summary": null,
"description": null
},
{
"name": "fields",
"type": "Optional",
"optional_inner": {
"type": "Array",
"array_item": {
"type": "Ref",
"ref_name": "abi.AbiParam"
}
},
"summary": null,
"description": null
}
],
"summary": null,
Expand Down Expand Up @@ -5457,6 +5477,42 @@
],
"summary": null,
"description": null
},
{
"name": "ParamsOfDecodeAccountData",
"type": "Struct",
"struct_fields": [
{
"name": "abi",
"type": "Ref",
"ref_name": "abi.Abi",
"summary": "Contract ABI",
"description": null
},
{
"name": "data",
"type": "String",
"summary": "Data BOC",
"description": "Must be encoded with base64"
}
],
"summary": null,
"description": null
},
{
"name": "ResultOfDecodeData",
"type": "Struct",
"struct_fields": [
{
"name": "data",
"type": "Ref",
"ref_name": "Value",
"summary": "Decoded data as a JSON structure.",
"description": null
}
],
"summary": null,
"description": null
}
],
"functions": [
Expand Down Expand Up @@ -5763,6 +5819,44 @@
]
},
"errors": null
},
{
"name": "decode_account_data",
"summary": "Decodes account data using provided data BOC and ABI.",
"description": "Note: this feature requires ABI 2.1 or higher.",
"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.ParamsOfDecodeAccountData",
"summary": null,
"description": null
}
],
"result": {
"type": "Generic",
"generic_name": "ClientResult",
"generic_args": [
{
"type": "Ref",
"ref_name": "abi.ResultOfDecodeData"
}
]
},
"errors": null
}
]
},
Expand Down Expand Up @@ -7374,6 +7468,32 @@
"summary": null,
"description": null
},
{
"name": "AccountAddressType",
"type": "EnumOfConsts",
"enum_consts": [
{
"name": "AccountId",
"type": "None",
"summary": null,
"description": null
},
{
"name": "Hex",
"type": "None",
"summary": null,
"description": null
},
{
"name": "Base64",
"type": "None",
"summary": null,
"description": null
}
],
"summary": null,
"description": null
},
{
"name": "ParamsOfConvertAddress",
"type": "Struct",
Expand Down Expand Up @@ -7409,6 +7529,35 @@
"summary": null,
"description": null
},
{
"name": "ParamsOfGetAddressType",
"type": "Struct",
"struct_fields": [
{
"name": "address",
"type": "String",
"summary": "Account address in any TON format.",
"description": null
}
],
"summary": null,
"description": null
},
{
"name": "ResultOfGetAddressType",
"type": "Struct",
"struct_fields": [
{
"name": "address_type",
"type": "Ref",
"ref_name": "utils.AccountAddressType",
"summary": "Account address type.",
"description": null
}
],
"summary": null,
"description": null
},
{
"name": "ParamsOfCalcStorageFee",
"type": "Struct",
Expand Down Expand Up @@ -7552,6 +7701,44 @@
},
"errors": null
},
{
"name": "get_address_type",
"summary": "Validates and returns the type of any TON address.",
"description": "Address types are the following\n\n`0:919db8e740d50bf349df2eea03fa30c385d846b991ff5542e67098ee833fc7f7` - standart TON address most\ncommonly used in all cases. Also called as hex addres\n`919db8e740d50bf349df2eea03fa30c385d846b991ff5542e67098ee833fc7f7` - account ID. A part of full\naddress. Identifies account inside particular workchain\n`EQCRnbjnQNUL80nfLuoD+jDDhdhGuZH/VULmcJjugz/H9wam` - base64 address. Also called \"user-friendly\".\nWas used at the beginning of TON. Now it is supported for compatibility",
"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": "utils.ParamsOfGetAddressType",
"summary": null,
"description": null
}
],
"result": {
"type": "Generic",
"generic_name": "ClientResult",
"generic_args": [
{
"type": "Ref",
"ref_name": "utils.ResultOfGetAddressType"
}
]
},
"errors": null
},
{
"name": "calc_storage_fee",
"summary": "Calculates storage fee for an account over a specified time period",
Expand Down
28 changes: 27 additions & 1 deletion client/mod_abi.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 05 Jul 21 06:21 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 21 11:03 UTC
//
// Mod abi
//
Expand All @@ -27,6 +27,7 @@ const (
InvalidSignerAbiErrorCode = 310
InvalidAbiAbiErrorCode = 311
InvalidFunctionIDAbiErrorCode = 312
InvalidDataAbiErrorCode = 313
)

func init() { // nolint gochecknoinits
Expand All @@ -42,6 +43,7 @@ func init() { // nolint gochecknoinits
errorCodesToErrorTypes[InvalidSignerAbiErrorCode] = "InvalidSignerAbiErrorCode"
errorCodesToErrorTypes[InvalidAbiAbiErrorCode] = "InvalidAbiAbiErrorCode"
errorCodesToErrorTypes[InvalidFunctionIDAbiErrorCode] = "InvalidFunctionIDAbiErrorCode"
errorCodesToErrorTypes[InvalidDataAbiErrorCode] = "InvalidDataAbiErrorCode"
}

type AbiHandle uint32
Expand Down Expand Up @@ -435,6 +437,7 @@ type AbiContract struct {
Functions []AbiFunction `json:"functions"` // optional
Events []AbiEvent `json:"events"` // optional
Data []AbiData `json:"data"` // optional
Fields []AbiParam `json:"fields"` // optional
}

type ParamsOfEncodeMessageBody struct {
Expand Down Expand Up @@ -639,6 +642,19 @@ type ResultOfEncodeAccount struct {
ID string `json:"id"`
}

type ParamsOfDecodeAccountData struct {
// Contract ABI.
Abi Abi `json:"abi"`
// Data BOC.
// Must be encoded with base64.
Data string `json:"data"`
}

type ResultOfDecodeData struct {
// Decoded data as a JSON structure.
Data json.RawMessage `json:"data"`
}

// Encodes message body according to ABI function call.
func (c *Client) AbiEncodeMessageBody(p *ParamsOfEncodeMessageBody) (*ResultOfEncodeMessageBody, error) {
result := new(ResultOfEncodeMessageBody)
Expand Down Expand Up @@ -756,3 +772,13 @@ func (c *Client) AbiEncodeAccount(p *ParamsOfEncodeAccount) (*ResultOfEncodeAcco

return result, err
}

// Decodes account data using provided data BOC and ABI.
// Note: this feature requires ABI 2.1 or higher.
func (c *Client) AbiDecodeAccountData(p *ParamsOfDecodeAccountData) (*ResultOfDecodeData, error) {
result := new(ResultOfDecodeData)

err := c.dllClient.waitErrorOrResultUnmarshal("abi.decode_account_data", p, result)

return result, err
}
2 changes: 1 addition & 1 deletion client/mod_boc.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 05 Jul 21 06:21 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 21 11:03 UTC
//
// Mod boc
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_client.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 05 Jul 21 06:21 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 21 11:03 UTC
//
// Mod client
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_crypto.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 05 Jul 21 06:21 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 21 11:03 UTC
//
// Mod crypto
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_debot.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 05 Jul 21 06:21 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 21 11:03 UTC
//
// Mod debot
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_net.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 05 Jul 21 06:21 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 21 11:03 UTC
//
// Mod net
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_processing.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 05 Jul 21 06:21 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 21 11:03 UTC
//
// Mod processing
//
Expand Down
2 changes: 1 addition & 1 deletion client/mod_tvm.gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package client

// DON'T EDIT THIS FILE! It is generated via 'task generate' at 05 Jul 21 06:21 UTC
// DON'T EDIT THIS FILE! It is generated via 'task generate' at 09 Jul 21 11:03 UTC
//
// Mod tvm
//
Expand Down
Loading

0 comments on commit 072ea8a

Please sign in to comment.