From f5e370dd5b887b7bb0861207fadb8cfff92cc00e Mon Sep 17 00:00:00 2001 From: Boris Strelnikov Date: Wed, 15 Feb 2023 13:36:43 +0300 Subject: [PATCH] [v1.41.0-rc] Add support for SDK 1.41.0 --- Readme.md | 2 +- api-spec.json | 369 ++++++++++++++++++++++++++++++---- client/mod_abi.gen.go | 12 +- client/mod_boc.gen.go | 2 +- client/mod_client.gen.go | 18 +- client/mod_crypto.gen.go | 54 +++-- client/mod_debot.gen.go | 2 +- client/mod_net.gen.go | 16 +- client/mod_processing.gen.go | 55 +++-- client/mod_proofs.gen.go | 2 +- client/mod_tvm.gen.go | 4 +- client/mod_utils.gen.go | 2 +- clienttest/mod_crypto_test.go | 3 +- 13 files changed, 458 insertions(+), 83 deletions(-) diff --git a/Readme.md b/Readme.md index 3bbe2eb..1cff0df 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.40.0-green.svg)](https://github.com/tonlabs/EVER-SDK/tree/1.40.0) +[![EVER-SDK](https://img.shields.io/badge/EVER_SDK-1.41.0-green.svg)](https://github.com/tonlabs/EVER-SDK/tree/1.41.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 a46c1a6..e510763 100644 --- a/api-spec.json +++ b/api-spec.json @@ -1,5 +1,5 @@ { - "version": "1.40.0", + "version": "1.41.0", "modules": [ { "name": "client", @@ -299,6 +299,16 @@ "name": "ClientConfig", "type": "Struct", "struct_fields": [ + { + "name": "binding", + "type": "Optional", + "optional_inner": { + "type": "Ref", + "ref_name": "client.BindingConfig" + }, + "summary": null, + "description": null + }, { "name": "network", "type": "Optional", @@ -540,6 +550,17 @@ "summary": "UNSTABLE.", "description": "Subsequent REMP status awaiting timeout. If no status received during the timeout than fallback transaction scenario is activated.\n\nMust be specified in milliseconds. Default is 5000 (5 sec)." }, + { + "name": "signature_id", + "type": "Optional", + "optional_inner": { + "type": "Number", + "number_type": "Int", + "number_size": 32 + }, + "summary": "Network signature ID which is used by VM in signature verifying instructions if capability `CapSignatureWithId` is enabled in blockchain configuration parameters.", + "description": "This parameter should be set to `global_id` field from any blockchain block if network can\nnot be reachable at the moment of message encoding and the message is aimed to be sent into\nnetwork with `CapSignatureWithId` enabled. Otherwise signature ID is detected automatically\ninside message encoding functions" + }, { "name": "access_key", "type": "Optional", @@ -553,6 +574,32 @@ "summary": null, "description": null }, + { + "name": "BindingConfig", + "type": "Struct", + "struct_fields": [ + { + "name": "library", + "type": "Optional", + "optional_inner": { + "type": "String" + }, + "summary": null, + "description": null + }, + { + "name": "version", + "type": "Optional", + "optional_inner": { + "type": "String" + }, + "summary": null, + "description": null + } + ], + "summary": null, + "description": null + }, { "name": "NetworkQueriesProtocol", "type": "EnumOfConsts", @@ -581,11 +628,10 @@ "name": "mnemonic_dictionary", "type": "Optional", "optional_inner": { - "type": "Number", - "number_type": "UInt", - "number_size": 8 + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary" }, - "summary": "Mnemonic dictionary that will be used by default in crypto functions. If not specified, 1 dictionary will be used.", + "summary": "Mnemonic dictionary that will be used by default in crypto functions. If not specified, `English` dictionary will be used.", "description": null }, { @@ -1547,9 +1593,8 @@ "struct_fields": [ { "name": "dictionary", - "type": "Number", - "number_type": "UInt", - "number_size": 8, + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary", "summary": null, "description": null }, @@ -1577,9 +1622,8 @@ }, { "name": "dictionary", - "type": "Number", - "number_type": "UInt", - "number_size": 8, + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary", "summary": null, "description": null }, @@ -1722,6 +1766,77 @@ "summary": null, "description": null }, + { + "name": "MnemonicDictionary", + "type": "EnumOfConsts", + "enum_consts": [ + { + "name": "Ton", + "type": "Number", + "value": "0", + "summary": "TON compatible dictionary", + "description": null + }, + { + "name": "English", + "type": "Number", + "value": "1", + "summary": "English BIP-39 dictionary", + "description": null + }, + { + "name": "ChineseSimplified", + "type": "Number", + "value": "2", + "summary": "Chinese simplified BIP-39 dictionary", + "description": null + }, + { + "name": "ChineseTraditional", + "type": "Number", + "value": "3", + "summary": "Chinese traditional BIP-39 dictionary", + "description": null + }, + { + "name": "French", + "type": "Number", + "value": "4", + "summary": "French BIP-39 dictionary", + "description": null + }, + { + "name": "Italian", + "type": "Number", + "value": "5", + "summary": "Italian BIP-39 dictionary", + "description": null + }, + { + "name": "Japanese", + "type": "Number", + "value": "6", + "summary": "Japanese BIP-39 dictionary", + "description": null + }, + { + "name": "Korean", + "type": "Number", + "value": "7", + "summary": "Korean BIP-39 dictionary", + "description": null + }, + { + "name": "Spanish", + "type": "Number", + "value": "8", + "summary": "Spanish BIP-39 dictionary", + "description": null + } + ], + "summary": null, + "description": null + }, { "name": "ParamsOfFactorize", "type": "Struct", @@ -2372,9 +2487,8 @@ "name": "dictionary", "type": "Optional", "optional_inner": { - "type": "Number", - "number_type": "UInt", - "number_size": 8 + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary" }, "summary": "Dictionary identifier", "description": null @@ -2405,9 +2519,8 @@ "name": "dictionary", "type": "Optional", "optional_inner": { - "type": "Number", - "number_type": "UInt", - "number_size": 8 + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary" }, "summary": "Dictionary identifier", "description": null @@ -2455,9 +2568,8 @@ "name": "dictionary", "type": "Optional", "optional_inner": { - "type": "Number", - "number_type": "UInt", - "number_size": 8 + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary" }, "summary": "Dictionary identifier", "description": null @@ -2505,9 +2617,8 @@ "name": "dictionary", "type": "Optional", "optional_inner": { - "type": "Number", - "number_type": "UInt", - "number_size": 8 + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary" }, "summary": "Dictionary identifier", "description": null @@ -2564,9 +2675,8 @@ "name": "dictionary", "type": "Optional", "optional_inner": { - "type": "Number", - "number_type": "UInt", - "number_size": 8 + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary" }, "summary": "Dictionary identifier", "description": null @@ -2600,9 +2710,8 @@ "name": "dictionary", "type": "Optional", "optional_inner": { - "type": "Number", - "number_type": "UInt", - "number_size": 8 + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary" }, "summary": "Dictionary identifier", "description": null @@ -2920,9 +3029,8 @@ }, { "name": "dictionary", - "type": "Number", - "number_type": "UInt", - "number_size": 8, + "type": "Ref", + "ref_name": "crypto.MnemonicDictionary", "summary": null, "description": null }, @@ -6210,6 +6318,17 @@ }, "summary": "Destination address of the message", "description": "Since ABI version 2.3 destination address of external inbound message is used in message\nbody signature calculation. Should be provided when signed external inbound message body is\ncreated. Otherwise can be omitted." + }, + { + "name": "signature_id", + "type": "Optional", + "optional_inner": { + "type": "Number", + "number_type": "Int", + "number_size": 32 + }, + "summary": "Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled", + "description": null } ], "summary": null, @@ -6342,6 +6461,17 @@ }, "summary": "Processing try index.", "description": "Used in message processing with retries (if contract's ABI includes \"expire\" header).\n\nEncoder uses the provided try index to calculate message\nexpiration time. The 1st message expiration time is specified in\nClient config.\n\nExpiration timeouts will grow with every retry.\nRetry grow factor is set in Client config:\n<.....add config parameter with default value here>\n\nDefault value is 0." + }, + { + "name": "signature_id", + "type": "Optional", + "optional_inner": { + "type": "Number", + "number_type": "Int", + "number_size": 32 + }, + "summary": "Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled", + "description": null } ], "summary": null, @@ -7150,6 +7280,17 @@ "type": "String", "summary": "Message BOC encoded in `base64`.", "description": null + }, + { + "name": "signature_id", + "type": "Optional", + "optional_inner": { + "type": "Number", + "number_type": "Int", + "number_size": 32 + }, + "summary": "Signature ID to be used in unsigned data preparing when CapSignatureWithId capability is enabled", + "description": null } ], "summary": null, @@ -7166,9 +7307,9 @@ "description": null }, { - "name": "hash", + "name": "unsigned", "type": "String", - "summary": "Hash to verify the signature in `base64`.", + "summary": "Data to verify the signature in `base64`.", "description": null } ], @@ -9540,7 +9681,20 @@ { "name": "WillFetchFirstBlock", "type": "Struct", - "struct_fields": [], + "struct_fields": [ + { + "name": "message_id", + "type": "String", + "summary": null, + "description": null + }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + } + ], "summary": "Notifies the application that the account's current shard block will be fetched from the network. This step is performed before the message sending so that sdk knows starting from which block it will search for the transaction.", "description": "Fetched block will be used later in waiting phase." }, @@ -9554,6 +9708,18 @@ "ref_name": "client.ClientError", "summary": null, "description": null + }, + { + "name": "message_id", + "type": "String", + "summary": null, + "description": null + }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null } ], "summary": "Notifies the app that the client has failed to fetch the account's current shard block.", @@ -9575,6 +9741,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "message", "type": "String", @@ -9601,6 +9773,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "message", "type": "String", @@ -9627,6 +9805,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "message", "type": "String", @@ -9660,6 +9844,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "message", "type": "String", @@ -9686,6 +9876,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "message", "type": "String", @@ -9713,6 +9909,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "message", "type": "String", @@ -9740,6 +9942,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "timestamp", "type": "BigInt", @@ -9769,6 +9977,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "timestamp", "type": "BigInt", @@ -9798,6 +10012,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "timestamp", "type": "BigInt", @@ -9827,6 +10047,12 @@ "summary": null, "description": null }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "timestamp", "type": "BigInt", @@ -9850,6 +10076,18 @@ "name": "RempError", "type": "Struct", "struct_fields": [ + { + "name": "message_id", + "type": "String", + "summary": null, + "description": null + }, + { + "name": "message_dst", + "type": "String", + "summary": null, + "description": null + }, { "name": "error", "type": "Ref", @@ -10821,6 +11059,17 @@ }, "summary": "Overrides standard TVM behaviour. If set to `true` then CHKSIG always will return `true`.", "description": null + }, + { + "name": "signature_id", + "type": "Optional", + "optional_inner": { + "type": "Number", + "number_type": "Int", + "number_size": 32 + }, + "summary": "Signature ID to be used in signature verifying instructions when CapSignatureWithId capability is enabled", + "description": null } ], "summary": null, @@ -12502,6 +12751,25 @@ ], "summary": null, "description": null + }, + { + "name": "ResultOfGetSignatureId", + "type": "Struct", + "struct_fields": [ + { + "name": "signature_id", + "type": "Optional", + "optional_inner": { + "type": "Number", + "number_type": "Int", + "number_size": 32 + }, + "summary": "Signature ID for configured network if it should be used in messages signature", + "description": null + } + ], + "summary": null, + "description": null } ], "functions": [ @@ -13333,6 +13601,37 @@ ] }, "errors": null + }, + { + "name": "get_signature_id", + "summary": "Returns signature ID for configured network if it should be used in messages signature", + "description": null, + "params": [ + { + "name": "context", + "type": "Generic", + "generic_name": "Arc", + "generic_args": [ + { + "type": "Ref", + "ref_name": "ClientContext" + } + ], + "summary": null, + "description": null + } + ], + "result": { + "type": "Generic", + "generic_name": "ClientResult", + "generic_args": [ + { + "type": "Ref", + "ref_name": "net.ResultOfGetSignatureId" + } + ] + }, + "errors": null } ] }, diff --git a/client/mod_abi.gen.go b/client/mod_abi.gen.go index e6ccbff..e16da96 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod abi // @@ -482,6 +482,8 @@ type ParamsOfEncodeMessageBody struct { // body signature calculation. Should be provided when signed external inbound message body is // created. Otherwise can be omitted. Address null.String `json:"address"` // optional + // Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled. + SignatureID null.Int32 `json:"signature_id"` // optional } type ResultOfEncodeMessageBody struct { @@ -543,6 +545,8 @@ type ParamsOfEncodeMessage struct { // // Default value is 0. ProcessingTryIndex null.Uint8 `json:"processing_try_index"` // optional + // Signature ID to be used in data to sign preparing when CapSignatureWithId capability is enabled. + SignatureID null.Int32 `json:"signature_id"` // optional } type ResultOfEncodeMessage struct { @@ -787,13 +791,15 @@ type ParamsOfGetSignatureData struct { Abi Abi `json:"abi"` // Message BOC encoded in `base64`. Message string `json:"message"` + // Signature ID to be used in unsigned data preparing when CapSignatureWithId capability is enabled. + SignatureID null.Int32 `json:"signature_id"` // optional } type ResultOfGetSignatureData struct { // Signature from the message in `hex`. Signature string `json:"signature"` - // Hash to verify the signature in `base64`. - Hash string `json:"hash"` + // Data to verify the signature in `base64`. + Unsigned string `json:"unsigned"` } // Encodes message body according to ABI function call. diff --git a/client/mod_boc.gen.go b/client/mod_boc.gen.go index 4b4e0cc..4346b30 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod boc // diff --git a/client/mod_client.gen.go b/client/mod_client.gen.go index ffe95cb..8a901d7 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod client // @@ -98,6 +98,7 @@ type Error struct { } type Config struct { + Binding *BindingConfig `json:"binding"` // optional Network *NetworkConfig `json:"network"` // optional Crypto *CryptoConfig `json:"crypto"` // optional Abi *AbiConfig `json:"abi"` // optional @@ -170,10 +171,21 @@ type NetworkConfig struct { // // Must be specified in milliseconds. Default is 5000 (5 sec). NextRempStatusTimeout null.Uint32 `json:"next_remp_status_timeout"` // optional + // Network signature ID which is used by VM in signature verifying instructions if capability `CapSignatureWithId` is enabled in blockchain configuration parameters. + // This parameter should be set to `global_id` field from any blockchain block if network can + // not be reachable at the moment of message encoding and the message is aimed to be sent into + // network with `CapSignatureWithId` enabled. Otherwise signature ID is detected automatically + // inside message encoding functions. + SignatureID null.Int32 `json:"signature_id"` // optional // Access key to GraphQL API (Project secret). AccessKey null.String `json:"access_key"` // optional } +type BindingConfig struct { + Library null.String `json:"library"` // optional + Version null.String `json:"version"` // optional +} + type NetworkQueriesProtocol string const ( @@ -186,8 +198,8 @@ const ( // Crypto config. type CryptoConfig struct { - // Mnemonic dictionary that will be used by default in crypto functions. If not specified, 1 dictionary will be used. - MnemonicDictionary null.Uint8 `json:"mnemonic_dictionary"` // optional + // Mnemonic dictionary that will be used by default in crypto functions. If not specified, `English` dictionary will be used. + MnemonicDictionary *MnemonicDictionary `json:"mnemonic_dictionary"` // optional // Mnemonic word count that will be used by default in crypto functions. If not specified the default value will be 12. MnemonicWordCount null.Uint8 `json:"mnemonic_word_count"` // optional // Derivation path that will be used by default in crypto functions. If not specified `m/44'/396'/0'/0/0` will be used. diff --git a/client/mod_crypto.gen.go b/client/mod_crypto.gen.go index a3d0aee..eab6e7c 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod crypto // @@ -271,8 +271,8 @@ type NaclSecretBoxParamsEB struct { // // Get `encrypted_secret` with `get_crypto_box_info` function and store it on your side. type RandomSeedPhraseCryptoBoxSecret struct { - Dictionary uint8 `json:"dictionary"` - Wordcount uint8 `json:"wordcount"` + Dictionary MnemonicDictionary `json:"dictionary"` + Wordcount uint8 `json:"wordcount"` } // Restores crypto box instance from an existing seed phrase. This type should be used when Crypto Box is initialized from a seed phrase, entered by a user. @@ -281,9 +281,9 @@ type RandomSeedPhraseCryptoBoxSecret struct { // // Get `encrypted_secret` with `get_crypto_box_info` function and store it on your side. type PredefinedSeedPhraseCryptoBoxSecret struct { - Phrase string `json:"phrase"` - Dictionary uint8 `json:"dictionary"` - Wordcount uint8 `json:"wordcount"` + Phrase string `json:"phrase"` + Dictionary MnemonicDictionary `json:"dictionary"` + Wordcount uint8 `json:"wordcount"` } // Use this type for wallet reinitializations, when you already have `encrypted_secret` on hands. To get `encrypted_secret`, use `get_crypto_box_info` function after you initialized your crypto box for the first time. @@ -492,6 +492,30 @@ type NaclSecretBoxParamsCB struct { Nonce string `json:"nonce"` } +type MnemonicDictionary int + +const ( + + // TON compatible dictionary. + TonMnemonicDictionary MnemonicDictionary = 0 + // English BIP-39 dictionary. + EnglishMnemonicDictionary MnemonicDictionary = 1 + // Chinese simplified BIP-39 dictionary. + ChineseSimplifiedMnemonicDictionary MnemonicDictionary = 2 + // Chinese traditional BIP-39 dictionary. + ChineseTraditionalMnemonicDictionary MnemonicDictionary = 3 + // French BIP-39 dictionary. + FrenchMnemonicDictionary MnemonicDictionary = 4 + // Italian BIP-39 dictionary. + ItalianMnemonicDictionary MnemonicDictionary = 5 + // Japanese BIP-39 dictionary. + JapaneseMnemonicDictionary MnemonicDictionary = 6 + // Korean BIP-39 dictionary. + KoreanMnemonicDictionary MnemonicDictionary = 7 + // Spanish BIP-39 dictionary. + SpanishMnemonicDictionary MnemonicDictionary = 8 +) + type ParamsOfFactorize struct { // Hexadecimal representation of u64 composite number. Composite string `json:"composite"` @@ -724,7 +748,7 @@ type ParamsOfNaclSecretBoxOpen struct { type ParamsOfMnemonicWords struct { // Dictionary identifier. - Dictionary null.Uint8 `json:"dictionary"` // optional + Dictionary *MnemonicDictionary `json:"dictionary"` // optional } type ResultOfMnemonicWords struct { @@ -734,7 +758,7 @@ type ResultOfMnemonicWords struct { type ParamsOfMnemonicFromRandom struct { // Dictionary identifier. - Dictionary null.Uint8 `json:"dictionary"` // optional + Dictionary *MnemonicDictionary `json:"dictionary"` // optional // Mnemonic word count. WordCount null.Uint8 `json:"word_count"` // optional } @@ -749,7 +773,7 @@ type ParamsOfMnemonicFromEntropy struct { // Hex encoded. Entropy string `json:"entropy"` // Dictionary identifier. - Dictionary null.Uint8 `json:"dictionary"` // optional + Dictionary *MnemonicDictionary `json:"dictionary"` // optional // Mnemonic word count. WordCount null.Uint8 `json:"word_count"` // optional } @@ -763,7 +787,7 @@ type ParamsOfMnemonicVerify struct { // Phrase. Phrase string `json:"phrase"` // Dictionary identifier. - Dictionary null.Uint8 `json:"dictionary"` // optional + Dictionary *MnemonicDictionary `json:"dictionary"` // optional // Word count. WordCount null.Uint8 `json:"word_count"` // optional } @@ -779,7 +803,7 @@ type ParamsOfMnemonicDeriveSignKeys struct { // Derivation path, for instance "m/44'/396'/0'/0/0". Path null.String `json:"path"` // optional // Dictionary identifier. - Dictionary null.Uint8 `json:"dictionary"` // optional + Dictionary *MnemonicDictionary `json:"dictionary"` // optional // Word count. WordCount null.Uint8 `json:"word_count"` // optional } @@ -788,7 +812,7 @@ type ParamsOfHDKeyXPrvFromMnemonic struct { // String with seed phrase. Phrase string `json:"phrase"` // Dictionary identifier. - Dictionary null.Uint8 `json:"dictionary"` // optional + Dictionary *MnemonicDictionary `json:"dictionary"` // optional // Mnemonic word count. WordCount null.Uint8 `json:"word_count"` // optional } @@ -994,9 +1018,9 @@ type ResultOfGetCryptoBoxInfo struct { } type ResultOfGetCryptoBoxSeedPhrase struct { - Phrase string `json:"phrase"` - Dictionary uint8 `json:"dictionary"` - Wordcount uint8 `json:"wordcount"` + Phrase string `json:"phrase"` + Dictionary MnemonicDictionary `json:"dictionary"` + Wordcount uint8 `json:"wordcount"` } type ParamsOfGetSigningBoxFromCryptoBox struct { diff --git a/client/mod_debot.gen.go b/client/mod_debot.gen.go index 1bf39ec..99df238 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod debot // diff --git a/client/mod_net.gen.go b/client/mod_net.gen.go index 17676a8..2611c1c 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod net // @@ -524,6 +524,11 @@ type ResultOfIteratorNext struct { ResumeState json.RawMessage `json:"resume_state"` // optional } +type ResultOfGetSignatureId struct { + // Signature ID for configured network if it should be used in messages signature. + SignatureID null.Int32 `json:"signature_id"` // optional +} + // Performs DAppServer GraphQL query. func (c *Client) NetQuery(p *ParamsOfQuery) (*ResultOfQuery, error) { result := new(ResultOfQuery) @@ -854,3 +859,12 @@ func (c *Client) NetRemoveIterator(p *RegisteredIterator) error { return err } + +// Returns signature ID for configured network if it should be used in messages signature. +func (c *Client) NetGetSignatureId() (*ResultOfGetSignatureId, error) { + result := new(ResultOfGetSignatureId) + + err := c.dllClient.waitErrorOrResultUnmarshal("net.get_signature_id", nil, result) + + return result, err +} diff --git a/client/mod_processing.gen.go b/client/mod_processing.gen.go index 80e17ef..df8b689 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod processing // @@ -54,20 +54,26 @@ func init() { // nolint gochecknoinits // Notifies the application that the account's current shard block will be fetched from the network. This step is performed before the message sending so that sdk knows starting from which block it will search for the transaction. // Fetched block will be used later in waiting phase. -type WillFetchFirstBlockProcessingEvent struct{} +type WillFetchFirstBlockProcessingEvent struct { + MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` +} // Notifies the app that the client has failed to fetch the account's current shard block. // This may happen due to the network issues. Receiving this event means that message processing will not proceed - // message was not sent, and Developer can try to run `process_message` again, // in the hope that the connection is restored. type FetchFirstBlockFailedProcessingEvent struct { - Error Error `json:"error"` + Error Error `json:"error"` + MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` } // Notifies the app that the message will be sent to the network. This event means that the account's current shard block was successfully fetched and the message was successfully created (`abi.encode_message` function was executed successfully). type WillSendProcessingEvent struct { ShardBlockID string `json:"shard_block_id"` MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` Message string `json:"message"` } @@ -76,6 +82,7 @@ type WillSendProcessingEvent struct { type DidSendProcessingEvent struct { ShardBlockID string `json:"shard_block_id"` MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` Message string `json:"message"` } @@ -90,6 +97,7 @@ type DidSendProcessingEvent struct { type SendFailedProcessingEvent struct { ShardBlockID string `json:"shard_block_id"` MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` Message string `json:"message"` Error Error `json:"error"` } @@ -104,6 +112,7 @@ type SendFailedProcessingEvent struct { type WillFetchNextBlockProcessingEvent struct { ShardBlockID string `json:"shard_block_id"` MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` Message string `json:"message"` } @@ -117,6 +126,7 @@ type WillFetchNextBlockProcessingEvent struct { type FetchNextBlockFailedProcessingEvent struct { ShardBlockID string `json:"shard_block_id"` MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` Message string `json:"message"` Error Error `json:"error"` } @@ -129,42 +139,49 @@ type FetchNextBlockFailedProcessingEvent struct { // the maximum retries count or receives a successful result. All the processing // events will be repeated. type MessageExpiredProcessingEvent struct { - MessageID string `json:"message_id"` - Message string `json:"message"` - Error Error `json:"error"` + MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` + Message string `json:"message"` + Error Error `json:"error"` } // Notifies the app that the message has been delivered to the thread's validators. type RempSentToValidatorsProcessingEvent struct { - MessageID string `json:"message_id"` - Timestamp big.Int `json:"timestamp"` - JSON json.RawMessage `json:"json"` + MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` + Timestamp big.Int `json:"timestamp"` + JSON json.RawMessage `json:"json"` } // Notifies the app that the message has been successfully included into a block candidate by the thread's collator. type RempIncludedIntoBlockProcessingEvent struct { - MessageID string `json:"message_id"` - Timestamp big.Int `json:"timestamp"` - JSON json.RawMessage `json:"json"` + MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` + Timestamp big.Int `json:"timestamp"` + JSON json.RawMessage `json:"json"` } // Notifies the app that the block candidate with the message has been accepted by the thread's validators. type RempIncludedIntoAcceptedBlockProcessingEvent struct { - MessageID string `json:"message_id"` - Timestamp big.Int `json:"timestamp"` - JSON json.RawMessage `json:"json"` + MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` + Timestamp big.Int `json:"timestamp"` + JSON json.RawMessage `json:"json"` } // Notifies the app about some other minor REMP statuses occurring during message processing. type RempOtherProcessingEvent struct { - MessageID string `json:"message_id"` - Timestamp big.Int `json:"timestamp"` - JSON json.RawMessage `json:"json"` + MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` + Timestamp big.Int `json:"timestamp"` + JSON json.RawMessage `json:"json"` } // Notifies the app about any problem that has occurred in REMP processing - in this case library switches to the fallback transaction awaiting scenario (sequential block reading). type RempErrorProcessingEvent struct { - Error Error `json:"error"` + MessageID string `json:"message_id"` + MessageDst string `json:"message_dst"` + Error Error `json:"error"` } type ProcessingEvent struct { diff --git a/client/mod_proofs.gen.go b/client/mod_proofs.gen.go index d782909..b3f3c99 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod proofs // diff --git a/client/mod_tvm.gen.go b/client/mod_tvm.gen.go index 0f0fc15..512a0e4 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod tvm // @@ -58,6 +58,8 @@ type ExecutionOptions struct { TransactionLt *big.Int `json:"transaction_lt"` // optional // Overrides standard TVM behaviour. If set to `true` then CHKSIG always will return `true`. ChksigAlwaysSucceed null.Bool `json:"chksig_always_succeed"` // optional + // Signature ID to be used in signature verifying instructions when CapSignatureWithId capability is enabled. + SignatureID null.Int32 `json:"signature_id"` // optional } // Non-existing account to run a creation internal message. Should be used with `skip_transaction_check = true` if the message has no deploy data since transactions on the uninitialized account are always aborted. diff --git a/client/mod_utils.gen.go b/client/mod_utils.gen.go index f472ef0..ac19350 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 28 Jan 23 13:55 UTC +// DON'T EDIT THIS FILE! It is generated via 'task generate' at 15 Feb 23 10:28 UTC // // Mod utils // diff --git a/clienttest/mod_crypto_test.go b/clienttest/mod_crypto_test.go index d59de5f..5371bdd 100644 --- a/clienttest/mod_crypto_test.go +++ b/clienttest/mod_crypto_test.go @@ -107,7 +107,8 @@ func TestModCryptoMnemonicWords(t *testing.T) { r, err := c.CryptoMnemonicWords(&client.ParamsOfMnemonicWords{}) a.NoError(err, "call crypto.mnemonic_words") a.Len(strings.Split(r.Words, " "), 2048, "default dictionary size") - r, err = c.CryptoMnemonicWords(&client.ParamsOfMnemonicWords{Dictionary: null.Uint8From(1)}) + dict := client.EnglishMnemonicDictionary + r, err = c.CryptoMnemonicWords(&client.ParamsOfMnemonicWords{Dictionary: &dict}) a.NoError(err, "call crypto.mnemonic_words") a.Len(strings.Split(r.Words, " "), 2048, "default dictionary size") }