icparchive

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 icparchive provides a client for the "icparchive" 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 AccountIdentifier

type AccountIdentifier = []byte

type Agent

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

Agent is a client for the "icparchive" canister.

func NewAgent

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

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

func (Agent) GetBlocks

func (a Agent) GetBlocks(arg0 GetBlocksArgs) (*GetBlocksResult, error)

GetBlocks calls the "get_blocks" method on the "icparchive" canister.

func (Agent) GetEncodedBlocks added in v0.3.4

func (a Agent) GetEncodedBlocks(arg0 GetBlocksArgs) (*GetEncodedBlocksResult, error)

GetEncodedBlocks calls the "get_encoded_blocks" method on the "icparchive" canister.

type Block

type Block struct {
	ParentHash  *[]byte     `ic:"parent_hash,omitempty" json:"parent_hash,omitempty"`
	Transaction Transaction `ic:"transaction" json:"transaction"`
	Timestamp   Timestamp   `ic:"timestamp" json:"timestamp"`
}

type BlockIndex

type BlockIndex = uint64

type BlockRange

type BlockRange struct {
	Blocks []Block `ic:"blocks" json:"blocks"`
}

type GetBlocksArgs

type GetBlocksArgs struct {
	Start  BlockIndex `ic:"start" json:"start"`
	Length uint64     `ic:"length" json:"length"`
}

type GetBlocksError

type GetBlocksError struct {
	BadFirstBlockIndex *struct {
		RequestedIndex  BlockIndex `ic:"requested_index" json:"requested_index"`
		FirstValidIndex BlockIndex `ic:"first_valid_index" json:"first_valid_index"`
	} `ic:"BadFirstBlockIndex,variant"`
	Other *struct {
		ErrorCode    uint64 `ic:"error_code" json:"error_code"`
		ErrorMessage string `ic:"error_message" json:"error_message"`
	} `ic:"Other,variant"`
}

type GetBlocksResult

type GetBlocksResult struct {
	Ok  *BlockRange     `ic:"Ok,variant"`
	Err *GetBlocksError `ic:"Err,variant"`
}

type GetEncodedBlocksResult added in v0.3.4

type GetEncodedBlocksResult struct {
	Ok  *[][]byte       `ic:"Ok,variant"`
	Err *GetBlocksError `ic:"Err,variant"`
}

type Memo

type Memo = uint64

type Operation

type Operation struct {
	Mint *struct {
		To     AccountIdentifier `ic:"to" json:"to"`
		Amount Tokens            `ic:"amount" json:"amount"`
	} `ic:"Mint,variant"`
	Burn *struct {
		From    AccountIdentifier  `ic:"from" json:"from"`
		Spender *AccountIdentifier `ic:"spender,omitempty" json:"spender,omitempty"`
		Amount  Tokens             `ic:"amount" json:"amount"`
	} `ic:"Burn,variant"`
	Transfer *struct {
		From    AccountIdentifier `ic:"from" json:"from"`
		To      AccountIdentifier `ic:"to" json:"to"`
		Amount  Tokens            `ic:"amount" json:"amount"`
		Fee     Tokens            `ic:"fee" json:"fee"`
		Spender *[]uint8          `ic:"spender,omitempty" json:"spender,omitempty"`
	} `ic:"Transfer,variant"`
	Approve *struct {
		From              AccountIdentifier `ic:"from" json:"from"`
		Spender           AccountIdentifier `ic:"spender" json:"spender"`
		AllowanceE8s      idl.Int           `ic:"allowance_e8s" json:"allowance_e8s"`
		Allowance         Tokens            `ic:"allowance" json:"allowance"`
		Fee               Tokens            `ic:"fee" json:"fee"`
		ExpiresAt         *Timestamp        `ic:"expires_at,omitempty" json:"expires_at,omitempty"`
		ExpectedAllowance *Tokens           `ic:"expected_allowance,omitempty" json:"expected_allowance,omitempty"`
	} `ic:"Approve,variant"`
}

type Timestamp

type Timestamp struct {
	TimestampNanos uint64 `ic:"timestamp_nanos" json:"timestamp_nanos"`
}

type Tokens

type Tokens struct {
	E8s uint64 `ic:"e8s" json:"e8s"`
}

type Transaction

type Transaction struct {
	Memo          Memo       `ic:"memo" json:"memo"`
	Icrc1Memo     *[]byte    `ic:"icrc1_memo,omitempty" json:"icrc1_memo,omitempty"`
	Operation     *Operation `ic:"operation,omitempty" json:"operation,omitempty"`
	CreatedAtTime Timestamp  `ic:"created_at_time" json:"created_at_time"`
}

Jump to

Keyboard shortcuts

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