diff --git a/api/openapi.yml b/api/openapi.yml index 4ed85e4..af660c7 100644 --- a/api/openapi.yml +++ b/api/openapi.yml @@ -614,6 +614,7 @@ paths: parameters: - $ref: '#/components/parameters/accountIDParameter' - $ref: '#/components/parameters/currenciesQuery' + - $ref: '#/components/parameters/supportedExtensions' responses: '200': description: account jettons balances @@ -1751,7 +1752,7 @@ paths: /v2/rates: get: - description: Get the token price to the currency + description: Get the token price in the chosen currency for display only. Don’t use this for financial transactions. operationId: getRates tags: - Rates @@ -3002,6 +3003,17 @@ components: items: type: string example: [ "ton", "usd", "rub" ] + supportedExtensions: + in: query + name: supported_extensions + description: "comma separated list supported extensions" + explode: false + required: false + schema: + type: array + items: + type: string + example: ["custom_payload"] currencyQuery: in: query name: currency @@ -5482,6 +5494,7 @@ components: - signers - approvals_num - expiration_date + - risk properties: address: type: string @@ -5509,6 +5522,8 @@ components: expiration_date: type: integer format: int64 + risk: + $ref: '#/components/schemas/Risk' Refund: type: object required: diff --git a/oas_client_gen.go b/oas_client_gen.go index 7e4f224..0f963cb 100644 --- a/oas_client_gen.go +++ b/oas_client_gen.go @@ -453,7 +453,8 @@ type Invoker interface { GetOutMsgQueueSizes(ctx context.Context) (*GetOutMsgQueueSizesOK, error) // GetRates invokes getRates operation. // - // Get the token price to the currency. + // Get the token price in the chosen currency for display only. Don’t use this for financial + // transactions. // // GET /v2/rates GetRates(ctx context.Context, params GetRatesParams) (*GetRatesOK, error) @@ -3574,6 +3575,29 @@ func (c *Client) sendGetAccountJettonsBalances(ctx context.Context, params GetAc return res, errors.Wrap(err, "encode query") } } + { + // Encode "supported_extensions" parameter. + cfg := uri.QueryParameterEncodingConfig{ + Name: "supported_extensions", + Style: uri.QueryStyleForm, + Explode: false, + } + + if err := q.EncodeParam(cfg, func(e uri.Encoder) error { + return e.EncodeArray(func(e uri.Encoder) error { + for i, item := range params.SupportedExtensions { + if err := func() error { + return e.EncodeValue(conv.StringToString(item)) + }(); err != nil { + return errors.Wrapf(err, "[%d]", i) + } + } + return nil + }) + }); err != nil { + return res, errors.Wrap(err, "encode query") + } + } u.RawQuery = q.Values().Encode() stage = "EncodeRequest" @@ -8295,7 +8319,8 @@ func (c *Client) sendGetOutMsgQueueSizes(ctx context.Context) (res *GetOutMsgQue // GetRates invokes getRates operation. // -// Get the token price to the currency. +// Get the token price in the chosen currency for display only. Don’t use this for financial +// transactions. // // GET /v2/rates func (c *Client) GetRates(ctx context.Context, params GetRatesParams) (*GetRatesOK, error) { diff --git a/oas_json_gen.go b/oas_json_gen.go index 37bb501..e913ea4 100644 --- a/oas_json_gen.go +++ b/oas_json_gen.go @@ -26317,9 +26317,13 @@ func (s *MultisigOrder) encodeFields(e *jx.Encoder) { e.FieldStart("expiration_date") e.Int64(s.ExpirationDate) } + { + e.FieldStart("risk") + s.Risk.Encode(e) + } } -var jsonFieldsNameOfMultisigOrder = [7]string{ +var jsonFieldsNameOfMultisigOrder = [8]string{ 0: "address", 1: "order_seqno", 2: "threshold", @@ -26327,6 +26331,7 @@ var jsonFieldsNameOfMultisigOrder = [7]string{ 4: "signers", 5: "approvals_num", 6: "expiration_date", + 7: "risk", } // Decode decodes MultisigOrder from json. @@ -26430,6 +26435,16 @@ func (s *MultisigOrder) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"expiration_date\"") } + case "risk": + requiredBitSet[0] |= 1 << 7 + if err := func() error { + if err := s.Risk.Decode(d); err != nil { + return err + } + return nil + }(); err != nil { + return errors.Wrap(err, "decode field \"risk\"") + } default: return d.Skip() } @@ -26440,7 +26455,7 @@ func (s *MultisigOrder) Decode(d *jx.Decoder) error { // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b01111111, + 0b11111111, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. diff --git a/oas_parameters_gen.go b/oas_parameters_gen.go index 7891f64..a0ed28a 100644 --- a/oas_parameters_gen.go +++ b/oas_parameters_gen.go @@ -173,6 +173,8 @@ type GetAccountJettonsBalancesParams struct { AccountID string // Accept ton and all possible fiat currencies, separated by commas. Currencies []string + // Comma separated list supported extensions. + SupportedExtensions []string } // GetAccountJettonsHistoryParams is parameters of getAccountJettonsHistory operation. diff --git a/oas_schemas_gen.go b/oas_schemas_gen.go index 5abafa6..7a494bf 100644 --- a/oas_schemas_gen.go +++ b/oas_schemas_gen.go @@ -8958,6 +8958,7 @@ type MultisigOrder struct { Signers []string `json:"signers"` ApprovalsNum int32 `json:"approvals_num"` ExpirationDate int64 `json:"expiration_date"` + Risk Risk `json:"risk"` } // GetAddress returns the value of Address. @@ -8995,6 +8996,11 @@ func (s *MultisigOrder) GetExpirationDate() int64 { return s.ExpirationDate } +// GetRisk returns the value of Risk. +func (s *MultisigOrder) GetRisk() Risk { + return s.Risk +} + // SetAddress sets the value of Address. func (s *MultisigOrder) SetAddress(val string) { s.Address = val @@ -9030,6 +9036,11 @@ func (s *MultisigOrder) SetExpirationDate(val int64) { s.ExpirationDate = val } +// SetRisk sets the value of Risk. +func (s *MultisigOrder) SetRisk(val Risk) { + s.Risk = val +} + // Ref: #/components/schemas/Multisigs type Multisigs struct { Multisigs []Multisig `json:"multisigs"` diff --git a/oas_validators_gen.go b/oas_validators_gen.go index 3ffbcbe..9a060da 100644 --- a/oas_validators_gen.go +++ b/oas_validators_gen.go @@ -3297,6 +3297,17 @@ func (s *MultisigOrder) Validate() error { Error: err, }) } + if err := func() error { + if err := s.Risk.Validate(); err != nil { + return err + } + return nil + }(); err != nil { + failures = append(failures, validate.FieldError{ + Name: "risk", + Error: err, + }) + } if len(failures) > 0 { return &validate.Error{Fields: failures} }