Skip to content

Regenerate code with the latest specification file (005bf643) #712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 47 additions & 7 deletions client/v2/algod/getApplicationBoxes.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,28 @@ import (
// GetApplicationBoxesParams contains all of the query parameters for url serialization.
type GetApplicationBoxesParams struct {

// Max max number of box names to return. If max is not set, or max == 0, returns
// all box-names.
// Max maximum number of boxes to return. Server may impose a lower limit.
Max uint64 `url:"max,omitempty"`

// Next a box name, in the goal app call arg form 'encoding:value'. When provided,
// the returned boxes begin (lexographically) with the supplied name. Callers may
// implement pagination by reinvoking the endpoint with the token from a previous
// call's next-token.
Next string `url:"next,omitempty"`

// Prefix a box name prefix, in the goal app call arg form 'encoding:value'. For
// ints, use the form 'int:1234'. For raw bytes, use the form 'b64:A=='. For
// printable strings, use the form 'str:hello'. For addresses, use the form
// 'addr:XYZ...'.
Prefix string `url:"prefix,omitempty"`

// Values if true, box values will be returned.
Values bool `url:"values,omitempty"`
}

// GetApplicationBoxes given an application ID, return all Box names. No particular
// ordering is guaranteed. Request fails when client or server-side configured
// limits prevent returning all Box names.
// GetApplicationBoxes given an application ID, return boxes in lexographical order
// by name. If the results must be truncated, a next-token is supplied to continue
// the request.
type GetApplicationBoxes struct {
c *Client

Expand All @@ -27,14 +41,40 @@ type GetApplicationBoxes struct {
p GetApplicationBoxesParams
}

// Max max number of box names to return. If max is not set, or max == 0, returns
// all box-names.
// Max maximum number of boxes to return. Server may impose a lower limit.
func (s *GetApplicationBoxes) Max(Max uint64) *GetApplicationBoxes {
s.p.Max = Max

return s
}

// Next a box name, in the goal app call arg form 'encoding:value'. When provided,
// the returned boxes begin (lexographically) with the supplied name. Callers may
// implement pagination by reinvoking the endpoint with the token from a previous
// call's next-token.
func (s *GetApplicationBoxes) Next(Next string) *GetApplicationBoxes {
s.p.Next = Next

return s
}

// Prefix a box name prefix, in the goal app call arg form 'encoding:value'. For
// ints, use the form 'int:1234'. For raw bytes, use the form 'b64:A=='. For
// printable strings, use the form 'str:hello'. For addresses, use the form
// 'addr:XYZ...'.
func (s *GetApplicationBoxes) Prefix(Prefix string) *GetApplicationBoxes {
s.p.Prefix = Prefix

return s
}

// Values if true, box values will be returned.
func (s *GetApplicationBoxes) Values(Values bool) *GetApplicationBoxes {
s.p.Values = Values

return s
}

// Do performs the HTTP request
func (s *GetApplicationBoxes) Do(ctx context.Context, headers ...*common.Header) (response models.BoxesResponse, err error) {
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/applications/%s/boxes", common.EscapeParams(s.applicationId)...), s.p, headers)
Expand Down
3 changes: 2 additions & 1 deletion client/v2/algod/getGenesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"github.com/algorand/go-algorand-sdk/v2/client/v2/common"
"github.com/algorand/go-algorand-sdk/v2/client/v2/common/models"
)

// GetGenesis returns the entire genesis file in json.
Expand All @@ -12,7 +13,7 @@ type GetGenesis struct {
}

// Do performs the HTTP request
func (s *GetGenesis) Do(ctx context.Context, headers ...*common.Header) (response string, err error) {
func (s *GetGenesis) Do(ctx context.Context, headers ...*common.Header) (response models.Genesis, err error) {
err = s.c.get(ctx, &response, "/genesis", nil, headers)
return
}
31 changes: 31 additions & 0 deletions client/v2/common/models/genesis.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package models

// Genesis defines a model for Genesis.
type Genesis struct {
// Alloc
Alloc []GenesisAllocation `json:"alloc"`

// Comment
Comment string `json:"comment,omitempty"`

// Devmode
Devmode bool `json:"devmode,omitempty"`

// Fees
Fees string `json:"fees"`

// Id
Id string `json:"id"`

// Network
Network string `json:"network"`

// Proto
Proto string `json:"proto"`

// Rwd
Rwd string `json:"rwd"`

// Timestamp
Timestamp uint64 `json:"timestamp"`
}
13 changes: 13 additions & 0 deletions client/v2/common/models/genesis_allocation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package models

// GenesisAllocation defines a model for GenesisAllocation.
type GenesisAllocation struct {
// Addr
Addr string `json:"addr"`

// Comment
Comment string `json:"comment"`

// State
State *map[string]interface{} `json:"state"`
}
11 changes: 0 additions & 11 deletions client/v2/common/models/kv_delta.go

This file was deleted.