icpledger

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package icpledger provides a client for the "icpledger" 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 AccountBalanceArgs

type AccountBalanceArgs = struct {
	Account AccountIdentifier `ic:"account"`
}

type AccountIdentifier

type AccountIdentifier = []byte

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent is a client for the "icpledger" canister.

func NewAgent

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

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

func (Agent) AccountBalance

func (a Agent) AccountBalance(arg0 AccountBalanceArgs) (*Tokens, error)

AccountBalance calls the "account_balance" method on the "icpledger" canister.

func (Agent) Archives

func (a Agent) Archives() (*Archives, error)

Archives calls the "archives" method on the "icpledger" canister.

func (Agent) Decimals

func (a Agent) Decimals() (*struct {
	Decimals uint32 `ic:"decimals"`
}, error)

Decimals calls the "decimals" method on the "icpledger" canister.

func (Agent) Name

func (a Agent) Name() (*struct {
	Name string `ic:"name"`
}, error)

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

func (Agent) QueryBlocks

func (a Agent) QueryBlocks(arg0 GetBlocksArgs) (*QueryBlocksResponse, error)

QueryBlocks calls the "query_blocks" method on the "icpledger" canister.

func (Agent) Symbol

func (a Agent) Symbol() (*struct {
	Symbol string `ic:"symbol"`
}, error)

Symbol calls the "symbol" method on the "icpledger" canister.

func (Agent) Transfer

func (a Agent) Transfer(arg0 TransferArgs) (*TransferResult, error)

Transfer calls the "transfer" method on the "icpledger" canister.

func (Agent) TransferFee

func (a Agent) TransferFee(arg0 TransferFeeArg) (*TransferFee, error)

TransferFee calls the "transfer_fee" method on the "icpledger" canister.

type Archive

type Archive = struct {
	CanisterId principal.Principal `ic:"canister_id"`
}

type Archives

type Archives = struct {
	Archives []Archive `ic:"archives"`
}

type Block

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

type BlockIndex

type BlockIndex = uint64

type BlockRange

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

type GetBlocksArgs

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

type Memo

type Memo = uint64

type Operation

type Operation = struct {
	Mint *struct {
		To     AccountIdentifier `ic:"to"`
		Amount Tokens            `ic:"amount"`
	} `ic:"Mint,variant"`
	Burn *struct {
		From   AccountIdentifier `ic:"from"`
		Amount Tokens            `ic:"amount"`
	} `ic:"Burn,variant"`
	Transfer *struct {
		From   AccountIdentifier `ic:"from"`
		To     AccountIdentifier `ic:"to"`
		Amount Tokens            `ic:"amount"`
		Fee    Tokens            `ic:"fee"`
	} `ic:"Transfer,variant"`
	Approve *struct {
		From         AccountIdentifier `ic:"from"`
		Spender      AccountIdentifier `ic:"spender"`
		AllowanceE8s idl.Int           `ic:"allowance_e8s"`
		Fee          Tokens            `ic:"fee"`
		ExpiresAt    *TimeStamp        `ic:"expires_at,omitempty"`
	} `ic:"Approve,variant"`
	TransferFrom *struct {
		From    AccountIdentifier `ic:"from"`
		To      AccountIdentifier `ic:"to"`
		Spender AccountIdentifier `ic:"spender"`
		Amount  Tokens            `ic:"amount"`
		Fee     Tokens            `ic:"fee"`
	} `ic:"TransferFrom,variant"`
}

type QueryArchiveError

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

type QueryArchiveFn

type QueryArchiveFn = struct {
}

type QueryArchiveResult

type QueryArchiveResult = struct {
	Ok  *BlockRange        `ic:"Ok,variant"`
	Err *QueryArchiveError `ic:"Err,variant"`
}

type QueryBlocksResponse

type QueryBlocksResponse = struct {
	ChainLength     uint64     `ic:"chain_length"`
	Certificate     *[]byte    `ic:"certificate,omitempty"`
	Blocks          []Block    `ic:"blocks"`
	FirstBlockIndex BlockIndex `ic:"first_block_index"`
	ArchivedBlocks  []struct {
		Start    BlockIndex     `ic:"start"`
		Length   uint64         `ic:"length"`
		Callback QueryArchiveFn `ic:"callback"`
	} `ic:"archived_blocks"`
}

type SubAccount

type SubAccount = []byte

type TimeStamp

type TimeStamp = struct {
	TimestampNanos uint64 `ic:"timestamp_nanos"`
}

type Tokens

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

type Transaction

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

type TransferArgs

type TransferArgs = struct {
	Memo           Memo              `ic:"memo"`
	Amount         Tokens            `ic:"amount"`
	Fee            Tokens            `ic:"fee"`
	FromSubaccount *SubAccount       `ic:"from_subaccount,omitempty"`
	To             AccountIdentifier `ic:"to"`
	CreatedAtTime  *TimeStamp        `ic:"created_at_time,omitempty"`
}

type TransferError

type TransferError = struct {
	BadFee *struct {
		ExpectedFee Tokens `ic:"expected_fee"`
	} `ic:"BadFee,variant"`
	InsufficientFunds *struct {
		Balance Tokens `ic:"balance"`
	} `ic:"InsufficientFunds,variant"`
	TxTooOld *struct {
		AllowedWindowNanos uint64 `ic:"allowed_window_nanos"`
	} `ic:"TxTooOld,variant"`
	TxCreatedInFuture *struct{} `ic:"TxCreatedInFuture,variant"`
	TxDuplicate       *struct {
		DuplicateOf BlockIndex `ic:"duplicate_of"`
	} `ic:"TxDuplicate,variant"`
}

type TransferFee

type TransferFee = struct {
	TransferFee Tokens `ic:"transfer_fee"`
}

type TransferFeeArg

type TransferFeeArg = struct {
}

type TransferResult

type TransferResult = struct {
	Ok  *BlockIndex    `ic:"Ok,variant"`
	Err *TransferError `ic:"Err,variant"`
}

Jump to

Keyboard shortcuts

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