-
Notifications
You must be signed in to change notification settings - Fork 93
/
accountAssetInformation.go
36 lines (28 loc) · 1.14 KB
/
accountAssetInformation.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package algod
import (
"context"
"fmt"
"github.com/algorand/go-algorand-sdk/v2/client/v2/common"
"github.com/algorand/go-algorand-sdk/v2/client/v2/common/models"
)
// AccountAssetInformationParams contains all of the query parameters for url serialization.
type AccountAssetInformationParams struct {
// Format configures whether the response object is JSON or MessagePack encoded. If
// not provided, defaults to JSON.
Format string `url:"format,omitempty"`
}
// AccountAssetInformation given a specific account public key and asset ID, this
// call returns the account's asset holding and asset parameters (if either exist).
// Asset parameters will only be returned if the provided address is the asset's
// creator.
type AccountAssetInformation struct {
c *Client
address string
assetId uint64
p AccountAssetInformationParams
}
// Do performs the HTTP request
func (s *AccountAssetInformation) Do(ctx context.Context, headers ...*common.Header) (response models.AccountAssetResponse, err error) {
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/accounts/%s/assets/%s", common.EscapeParams(s.address, s.assetId)...), s.p, headers)
return
}