Documentation
¶
Index ¶
- type Agent
- func (a Agent) Call(canisterID principal.Principal, methodName string, args []byte) (string, error)
- func (a Agent) CallCandid(canisterID principal.Principal, methodName string, args []byte) ([]idl.Type, []interface{}, error)
- func (a Agent) GetCanisterControllers(canisterID principal.Principal) ([]principal.Principal, error)
- func (a Agent) GetCanisterInfo(canisterID principal.Principal, subPath string) ([]byte, error)
- func (a Agent) GetCanisterModuleHash(canisterID principal.Principal) ([]byte, error)
- func (a Agent) Query(canisterID principal.Principal, methodName string, args []byte) (string, error)
- func (a Agent) QueryCandid(canisterID principal.Principal, methodName string, args []byte) ([]idl.Type, []interface{}, error)
- func (agent *Agent) RequestStatus(canisterID principal.Principal, requestID RequestID) ([]byte, cert.Node, error)
- func (a Agent) Sender() principal.Principal
- type AgentConfig
- type Client
- type ClientConfig
- type Envelope
- type Implementation
- type Request
- type RequestID
- type RequestType
- type Response
- type Status
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg AgentConfig) Agent
func (Agent) CallCandid ¶
func (Agent) GetCanisterControllers ¶
func (Agent) GetCanisterInfo ¶
func (Agent) GetCanisterModuleHash ¶
func (Agent) QueryCandid ¶
func (*Agent) RequestStatus ¶
type AgentConfig ¶
type AgentConfig struct {
Identity *identity.Identity
IngressExpiry time.Duration
ClientConfig *ClientConfig
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(cfg ClientConfig) Client
type ClientConfig ¶
type Implementation ¶
type Implementation struct {
// Source is the canonical location of the source code.
Source string
// Version is the version number of the implementation.
Version string
// Revision is the precise git revision of the implementation.
Revision string
}
Implementation identifies the implementation of the Internet Computer.
type Request ¶
type Request struct {
Type RequestType `cbor:"request_type"`
// The user who issued the request.
Sender principal.Principal `cbor:"sender"`
// Arbitrary user-provided data, typically randomly generated. This can be
// used to create distinct requests with otherwise identical fields.
Nonce []byte `cbor:"nonce"`
// An upper limit on the validity of the request, expressed in nanoseconds
// since 1970-01-01 (like ic0.time()).
IngressExpiry uint64 `cbor:"ingress_expiry"`
// The principal of the canister to call.
CanisterID principal.Principal `cbor:"canister_id"`
// Name of the canister method to call.
MethodName string `cbor:"method_name"`
// Argument to pass to the canister method.
Arguments []byte `cbor:"arg"`
// A list of paths, where a path is itself a sequence of blobs.
Paths [][][]byte `cbor:"paths,omitempty"`
}
DOCS: https://smartcontracts.org/docs/interface-spec/index.html#http-call
type RequestID ¶
type RequestID [32]byte
type RequestType ¶
type RequestType = string
const ( RequestTypeCall RequestType = "call" RequestTypeQuery RequestType = "query" RequestTypeReadState RequestType = "read_state" )
type Status ¶
type Status struct {
// Identifies the interface version supported.
Version string
// Impl describes the implementation of the Internet Computer.
Impl *Implementation
// The public key (a DER-encoded BLS key) of the root key of this Internet Computer instance.
RootKey []byte
}
Status describes various status fields of the Internet Computer.
func (*Status) UnmarshalCBOR ¶
Click to show internal directories.
Click to hide internal directories.