wallet

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package wallet provides a client for the "wallet" canister. Do NOT edit this file. It was automatically generated by https://github.com/aviate-labs/agent-go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressEntry added in v0.3.4

type AddressEntry struct {
	Id   principal.Principal `ic:"id" json:"id"`
	Name *string             `ic:"name,omitempty" json:"name,omitempty"`
	Kind Kind                `ic:"kind" json:"kind"`
	Role Role                `ic:"role" json:"role"`
}

type Agent

type Agent struct {
	*agent.Agent
	CanisterId principal.Principal
}

Agent is a client for the "wallet" canister.

func NewAgent

func NewAgent(canisterId principal.Principal, config agent.Config) (*Agent, error)

NewAgent creates a new agent for the "wallet" canister.

func (Agent) AddAddress added in v0.3.4

func (a Agent) AddAddress(address AddressEntry) error

AddAddress calls the "add_address" method on the "wallet" canister.

func (Agent) AddController added in v0.3.4

func (a Agent) AddController(arg0 principal.Principal) error

AddController calls the "add_controller" method on the "wallet" canister.

func (Agent) Authorize

func (a Agent) Authorize(arg0 principal.Principal) error

Authorize calls the "authorize" method on the "wallet" canister.

func (Agent) Deauthorize

func (a Agent) Deauthorize(arg0 principal.Principal) (*WalletResult, error)

Deauthorize calls the "deauthorize" method on the "wallet" canister.

func (Agent) GetChart added in v0.3.4

func (a Agent) GetChart(arg0 *struct {
	Count     *uint32 `ic:"count,omitempty" json:"count,omitempty"`
	Precision *uint64 `ic:"precision,omitempty" json:"precision,omitempty"`
}) (*[]struct {
	Field0 uint64 `ic:"0" json:"0"`
	Field1 uint64 `ic:"1" json:"1"`
}, error)

GetChart calls the "get_chart" method on the "wallet" canister.

func (Agent) GetControllers added in v0.3.4

func (a Agent) GetControllers() (*[]principal.Principal, error)

GetControllers calls the "get_controllers" method on the "wallet" canister.

func (Agent) GetCustodians added in v0.3.4

func (a Agent) GetCustodians() (*[]principal.Principal, error)

GetCustodians calls the "get_custodians" method on the "wallet" canister.

func (Agent) GetEvents added in v0.3.4

func (a Agent) GetEvents(arg0 *struct {
	From *uint32 `ic:"from,omitempty" json:"from,omitempty"`
	To   *uint32 `ic:"to,omitempty" json:"to,omitempty"`
}) (*[]Event, error)

GetEvents calls the "get_events" method on the "wallet" canister.

func (Agent) GetEvents128 added in v0.3.4

func (a Agent) GetEvents128(arg0 *struct {
	From *uint32 `ic:"from,omitempty" json:"from,omitempty"`
	To   *uint32 `ic:"to,omitempty" json:"to,omitempty"`
}) (*[]Event128, error)

GetEvents128 calls the "get_events128" method on the "wallet" canister.

func (Agent) GetManagedCanisterEvents added in v0.3.4

func (a Agent) GetManagedCanisterEvents(arg0 struct {
	Canister principal.Principal `ic:"canister" json:"canister"`
	From     *uint32             `ic:"from,omitempty" json:"from,omitempty"`
	To       *uint32             `ic:"to,omitempty" json:"to,omitempty"`
}) (**[]ManagedCanisterEvent, error)

GetManagedCanisterEvents calls the "get_managed_canister_events" method on the "wallet" canister.

func (Agent) GetManagedCanisterEvents128 added in v0.3.4

func (a Agent) GetManagedCanisterEvents128(arg0 struct {
	Canister principal.Principal `ic:"canister" json:"canister"`
	From     *uint32             `ic:"from,omitempty" json:"from,omitempty"`
	To       *uint32             `ic:"to,omitempty" json:"to,omitempty"`
}) (**[]ManagedCanisterEvent128, error)

GetManagedCanisterEvents128 calls the "get_managed_canister_events128" method on the "wallet" canister.

func (Agent) HttpRequest

func (a Agent) HttpRequest(request HttpRequest) (*HttpResponse, error)

HttpRequest calls the "http_request" method on the "wallet" canister.

func (Agent) ListAddresses added in v0.3.4

func (a Agent) ListAddresses() (*[]AddressEntry, error)

ListAddresses calls the "list_addresses" method on the "wallet" canister.

func (Agent) ListManagedCanisters added in v0.3.4

func (a Agent) ListManagedCanisters(arg0 struct {
	From *uint32 `ic:"from,omitempty" json:"from,omitempty"`
	To   *uint32 `ic:"to,omitempty" json:"to,omitempty"`
}) (*[]ManagedCanisterInfo, *uint32, error)

ListManagedCanisters calls the "list_managed_canisters" method on the "wallet" canister.

func (Agent) Name added in v0.3.4

func (a Agent) Name() (**string, error)

Name calls the "name" method on the "wallet" canister.

func (Agent) RemoveAddress added in v0.3.4

func (a Agent) RemoveAddress(address principal.Principal) (*WalletResult, error)

RemoveAddress calls the "remove_address" method on the "wallet" canister.

func (Agent) RemoveController added in v0.3.4

func (a Agent) RemoveController(arg0 principal.Principal) (*WalletResult, error)

RemoveController calls the "remove_controller" method on the "wallet" canister.

func (Agent) SetName added in v0.3.4

func (a Agent) SetName(arg0 string) error

SetName calls the "set_name" method on the "wallet" canister.

func (Agent) SetShortName added in v0.3.4

func (a Agent) SetShortName(arg0 principal.Principal, arg1 *string) (**ManagedCanisterInfo, error)

SetShortName calls the "set_short_name" method on the "wallet" canister.

func (Agent) WalletApiVersion added in v0.3.4

func (a Agent) WalletApiVersion() (*string, error)

WalletApiVersion calls the "wallet_api_version" method on the "wallet" canister.

func (Agent) WalletBalance added in v0.3.4

func (a Agent) WalletBalance() (*struct {
	Amount uint64 `ic:"amount" json:"amount"`
}, error)

WalletBalance calls the "wallet_balance" method on the "wallet" canister.

func (Agent) WalletBalance128 added in v0.3.4

func (a Agent) WalletBalance128() (*struct {
	Amount idl.Nat `ic:"amount" json:"amount"`
}, error)

WalletBalance128 calls the "wallet_balance128" method on the "wallet" canister.

func (Agent) WalletCall added in v0.3.4

func (a Agent) WalletCall(arg0 struct {
	Canister   principal.Principal `ic:"canister" json:"canister"`
	MethodName string              `ic:"method_name" json:"method_name"`
	Args       []byte              `ic:"args" json:"args"`
	Cycles     uint64              `ic:"cycles" json:"cycles"`
}) (*WalletResultCall, error)

WalletCall calls the "wallet_call" method on the "wallet" canister.

func (Agent) WalletCall128 added in v0.3.4

func (a Agent) WalletCall128(arg0 struct {
	Canister   principal.Principal `ic:"canister" json:"canister"`
	MethodName string              `ic:"method_name" json:"method_name"`
	Args       []byte              `ic:"args" json:"args"`
	Cycles     idl.Nat             `ic:"cycles" json:"cycles"`
}) (*WalletResultCall, error)

WalletCall128 calls the "wallet_call128" method on the "wallet" canister.

func (Agent) WalletCallWithMaxCycles added in v0.4.3

func (a Agent) WalletCallWithMaxCycles(arg0 struct {
	Canister   principal.Principal `ic:"canister" json:"canister"`
	MethodName string              `ic:"method_name" json:"method_name"`
	Args       []byte              `ic:"args" json:"args"`
}) (*WalletResultCallWithMaxCycles, error)

WalletCallWithMaxCycles calls the "wallet_call_with_max_cycles" method on the "wallet" canister.

func (Agent) WalletCreateCanister added in v0.3.4

func (a Agent) WalletCreateCanister(arg0 CreateCanisterArgs) (*WalletResultCreate, error)

WalletCreateCanister calls the "wallet_create_canister" method on the "wallet" canister.

func (Agent) WalletCreateCanister128 added in v0.3.4

func (a Agent) WalletCreateCanister128(arg0 CreateCanisterArgs128) (*WalletResultCreate, error)

WalletCreateCanister128 calls the "wallet_create_canister128" method on the "wallet" canister.

func (Agent) WalletCreateWallet added in v0.3.4

func (a Agent) WalletCreateWallet(arg0 CreateCanisterArgs) (*WalletResultCreate, error)

WalletCreateWallet calls the "wallet_create_wallet" method on the "wallet" canister.

func (Agent) WalletCreateWallet128 added in v0.3.4

func (a Agent) WalletCreateWallet128(arg0 CreateCanisterArgs128) (*WalletResultCreate, error)

WalletCreateWallet128 calls the "wallet_create_wallet128" method on the "wallet" canister.

func (Agent) WalletReceive added in v0.3.4

func (a Agent) WalletReceive(arg0 *ReceiveOptions) error

WalletReceive calls the "wallet_receive" method on the "wallet" canister.

func (Agent) WalletSend added in v0.3.4

func (a Agent) WalletSend(arg0 struct {
	Canister principal.Principal `ic:"canister" json:"canister"`
	Amount   uint64              `ic:"amount" json:"amount"`
}) (*WalletResult, error)

WalletSend calls the "wallet_send" method on the "wallet" canister.

func (Agent) WalletSend128 added in v0.3.4

func (a Agent) WalletSend128(arg0 struct {
	Canister principal.Principal `ic:"canister" json:"canister"`
	Amount   idl.Nat             `ic:"amount" json:"amount"`
}) (*WalletResult, error)

WalletSend128 calls the "wallet_send128" method on the "wallet" canister.

func (Agent) WalletStoreWalletWasm added in v0.3.4

func (a Agent) WalletStoreWalletWasm(arg0 struct {
	WasmModule []byte `ic:"wasm_module" json:"wasm_module"`
}) error

WalletStoreWalletWasm calls the "wallet_store_wallet_wasm" method on the "wallet" canister.

type CanisterSettings added in v0.3.4

type CanisterSettings struct {
	Controller        *principal.Principal   `ic:"controller,omitempty" json:"controller,omitempty"`
	Controllers       *[]principal.Principal `ic:"controllers,omitempty" json:"controllers,omitempty"`
	ComputeAllocation *idl.Nat               `ic:"compute_allocation,omitempty" json:"compute_allocation,omitempty"`
	MemoryAllocation  *idl.Nat               `ic:"memory_allocation,omitempty" json:"memory_allocation,omitempty"`
	FreezingThreshold *idl.Nat               `ic:"freezing_threshold,omitempty" json:"freezing_threshold,omitempty"`
}

type CreateCanisterArgs added in v0.3.4

type CreateCanisterArgs struct {
	Cycles   uint64           `ic:"cycles" json:"cycles"`
	Settings CanisterSettings `ic:"settings" json:"settings"`
}

type CreateCanisterArgs128 added in v0.3.4

type CreateCanisterArgs128 struct {
	Cycles   idl.Nat          `ic:"cycles" json:"cycles"`
	Settings CanisterSettings `ic:"settings" json:"settings"`
}

type Event added in v0.3.4

type Event struct {
	Id        uint32    `ic:"id" json:"id"`
	Timestamp uint64    `ic:"timestamp" json:"timestamp"`
	Kind      EventKind `ic:"kind" json:"kind"`
}

type Event128 added in v0.3.4

type Event128 struct {
	Id        uint32       `ic:"id" json:"id"`
	Timestamp uint64       `ic:"timestamp" json:"timestamp"`
	Kind      EventKind128 `ic:"kind" json:"kind"`
}

type EventKind added in v0.3.4

type EventKind struct {
	CyclesSent *struct {
		To     principal.Principal `ic:"to" json:"to"`
		Amount uint64              `ic:"amount" json:"amount"`
		Refund uint64              `ic:"refund" json:"refund"`
	} `ic:"CyclesSent,variant"`
	CyclesReceived *struct {
		From   principal.Principal `ic:"from" json:"from"`
		Amount uint64              `ic:"amount" json:"amount"`
		Memo   *string             `ic:"memo,omitempty" json:"memo,omitempty"`
	} `ic:"CyclesReceived,variant"`
	AddressAdded *struct {
		Id   principal.Principal `ic:"id" json:"id"`
		Name *string             `ic:"name,omitempty" json:"name,omitempty"`
		Role Role                `ic:"role" json:"role"`
	} `ic:"AddressAdded,variant"`
	AddressRemoved *struct {
		Id principal.Principal `ic:"id" json:"id"`
	} `ic:"AddressRemoved,variant"`
	CanisterCreated *struct {
		Canister principal.Principal `ic:"canister" json:"canister"`
		Cycles   uint64              `ic:"cycles" json:"cycles"`
	} `ic:"CanisterCreated,variant"`
	CanisterCalled *struct {
		Canister   principal.Principal `ic:"canister" json:"canister"`
		MethodName string              `ic:"method_name" json:"method_name"`
		Cycles     uint64              `ic:"cycles" json:"cycles"`
	} `ic:"CanisterCalled,variant"`
	WalletDeployed *struct {
		Canister principal.Principal `ic:"canister" json:"canister"`
	} `ic:"WalletDeployed,variant"`
}

type EventKind128 added in v0.3.4

type EventKind128 struct {
	CyclesSent *struct {
		To     principal.Principal `ic:"to" json:"to"`
		Amount idl.Nat             `ic:"amount" json:"amount"`
		Refund idl.Nat             `ic:"refund" json:"refund"`
	} `ic:"CyclesSent,variant"`
	CyclesReceived *struct {
		From   principal.Principal `ic:"from" json:"from"`
		Amount idl.Nat             `ic:"amount" json:"amount"`
		Memo   *string             `ic:"memo,omitempty" json:"memo,omitempty"`
	} `ic:"CyclesReceived,variant"`
	AddressAdded *struct {
		Id   principal.Principal `ic:"id" json:"id"`
		Name *string             `ic:"name,omitempty" json:"name,omitempty"`
		Role Role                `ic:"role" json:"role"`
	} `ic:"AddressAdded,variant"`
	AddressRemoved *struct {
		Id principal.Principal `ic:"id" json:"id"`
	} `ic:"AddressRemoved,variant"`
	CanisterCreated *struct {
		Canister principal.Principal `ic:"canister" json:"canister"`
		Cycles   idl.Nat             `ic:"cycles" json:"cycles"`
	} `ic:"CanisterCreated,variant"`
	CanisterCalled *struct {
		Canister   principal.Principal `ic:"canister" json:"canister"`
		MethodName string              `ic:"method_name" json:"method_name"`
		Cycles     idl.Nat             `ic:"cycles" json:"cycles"`
	} `ic:"CanisterCalled,variant"`
	WalletDeployed *struct {
		Canister principal.Principal `ic:"canister" json:"canister"`
	} `ic:"WalletDeployed,variant"`
}

type HeaderField

type HeaderField struct {
	Field0 string `ic:"0" json:"0"`
	Field1 string `ic:"1" json:"1"`
}

type HttpRequest

type HttpRequest struct {
	Method  string        `ic:"method" json:"method"`
	Url     string        `ic:"url" json:"url"`
	Headers []HeaderField `ic:"headers" json:"headers"`
	Body    []byte        `ic:"body" json:"body"`
}

type HttpResponse

type HttpResponse struct {
	StatusCode        uint16             `ic:"status_code" json:"status_code"`
	Headers           []HeaderField      `ic:"headers" json:"headers"`
	Body              []byte             `ic:"body" json:"body"`
	StreamingStrategy *StreamingStrategy `ic:"streaming_strategy,omitempty" json:"streaming_strategy,omitempty"`
}

type Kind added in v0.3.4

type Kind struct {
	Unknown  *idl.Null `ic:"Unknown,variant"`
	User     *idl.Null `ic:"User,variant"`
	Canister *idl.Null `ic:"Canister,variant"`
}

type ManagedCanisterEvent added in v0.3.4

type ManagedCanisterEvent struct {
	Id        uint32                   `ic:"id" json:"id"`
	Timestamp uint64                   `ic:"timestamp" json:"timestamp"`
	Kind      ManagedCanisterEventKind `ic:"kind" json:"kind"`
}

type ManagedCanisterEvent128 added in v0.3.4

type ManagedCanisterEvent128 struct {
	Id        uint32                      `ic:"id" json:"id"`
	Timestamp uint64                      `ic:"timestamp" json:"timestamp"`
	Kind      ManagedCanisterEventKind128 `ic:"kind" json:"kind"`
}

type ManagedCanisterEventKind added in v0.3.4

type ManagedCanisterEventKind struct {
	CyclesSent *struct {
		Amount uint64 `ic:"amount" json:"amount"`
		Refund uint64 `ic:"refund" json:"refund"`
	} `ic:"CyclesSent,variant"`
	Called *struct {
		MethodName string `ic:"method_name" json:"method_name"`
		Cycles     uint64 `ic:"cycles" json:"cycles"`
	} `ic:"Called,variant"`
	Created *struct {
		Cycles uint64 `ic:"cycles" json:"cycles"`
	} `ic:"Created,variant"`
}

type ManagedCanisterEventKind128 added in v0.3.4

type ManagedCanisterEventKind128 struct {
	CyclesSent *struct {
		Amount idl.Nat `ic:"amount" json:"amount"`
		Refund idl.Nat `ic:"refund" json:"refund"`
	} `ic:"CyclesSent,variant"`
	Called *struct {
		MethodName string  `ic:"method_name" json:"method_name"`
		Cycles     idl.Nat `ic:"cycles" json:"cycles"`
	} `ic:"Called,variant"`
	Created *struct {
		Cycles idl.Nat `ic:"cycles" json:"cycles"`
	} `ic:"Created,variant"`
}

type ManagedCanisterInfo added in v0.3.4

type ManagedCanisterInfo struct {
	Id        principal.Principal `ic:"id" json:"id"`
	Name      *string             `ic:"name,omitempty" json:"name,omitempty"`
	CreatedAt uint64              `ic:"created_at" json:"created_at"`
}

type ReceiveOptions added in v0.3.4

type ReceiveOptions struct {
	Memo *string `ic:"memo,omitempty" json:"memo,omitempty"`
}

type Role added in v0.3.4

type Role struct {
	Contact    *idl.Null `ic:"Contact,variant"`
	Custodian  *idl.Null `ic:"Custodian,variant"`
	Controller *idl.Null `ic:"Controller,variant"`
}

type StreamingCallbackHttpResponse

type StreamingCallbackHttpResponse struct {
	Body  []byte `ic:"body" json:"body"`
	Token *Token `ic:"token,omitempty" json:"token,omitempty"`
}

type StreamingStrategy

type StreamingStrategy struct {
	Callback *struct {
		Callback struct {
		} `ic:"callback" json:"callback"`
		Token Token `ic:"token" json:"token"`
	} `ic:"Callback,variant"`
}

type Token added in v0.3.4

type Token struct {
}

type WalletResult added in v0.3.4

type WalletResult struct {
	Ok  *idl.Null `ic:"Ok,variant"`
	Err *string   `ic:"Err,variant"`
}

type WalletResultCall added in v0.3.4

type WalletResultCall struct {
	Ok *struct {
		Return []byte `ic:"return" json:"return"`
	} `ic:"Ok,variant"`
	Err *string `ic:"Err,variant"`
}

type WalletResultCallWithMaxCycles added in v0.4.3

type WalletResultCallWithMaxCycles struct {
	Ok *struct {
		Return         []byte  `ic:"return" json:"return"`
		AttachedCycles idl.Nat `ic:"attached_cycles" json:"attached_cycles"`
	} `ic:"Ok,variant"`
	Err *string `ic:"Err,variant"`
}

type WalletResultCreate added in v0.3.4

type WalletResultCreate struct {
	Ok *struct {
		CanisterId principal.Principal `ic:"canister_id" json:"canister_id"`
	} `ic:"Ok,variant"`
	Err *string `ic:"Err,variant"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL