icperun

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package icperun contains functions to communicate to the Perun canister

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdjRequest

type AdjRequest = struct {
	Nonce             Nonce       `ic:"nonce"`
	Participants      []L2Account `ic:"participants"`
	ChallengeDuration Duration    `ic:"challenge_duration"`
	Channel           ChannelId   `ic:"channel"`
	Version           uint64      `ic:"version"`
	Allocation        []Amount    `ic:"allocation"`
	Finalized         bool        `ic:"finalized"`
	Sigs              []Signature `ic:"sigs"`
}

type Agent

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

func NewAgent

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

func (Agent) Conclude

func (a Agent) Conclude(arg0 AdjRequest) (Error, error)

func (Agent) Deposit

func (a Agent) Deposit(arg0 Funding) (*Error, error)

func (Agent) Dispute

func (a Agent) Dispute(arg0 AdjRequest) (Error, error)

func (Agent) QueryEvents

func (a Agent) QueryEvents(arg0 ChannelTime) (EventTxt, error)

func (Agent) QueryHoldings

func (a Agent) QueryHoldings(arg0 Funding) (**Amount, error)

func (Agent) QueryState

func (a Agent) QueryState(arg0 ChannelId) (*RegisteredState, error)

func (Agent) RegisterEvent

func (a Agent) RegisterEvent(arg0 FundMem) error

func (Agent) TransactionNotification

func (a Agent) TransactionNotification(arg0 uint64) (**Amount, error)

func (Agent) Withdraw

func (a Agent) Withdraw(arg0 WithdrawalRequest) (Error, error)

type Amount

type Amount = idl.Nat

func NewBigNat

func NewBigNat(b *big.Int) Amount

type ChannelId

type ChannelId = [32]byte

type ChannelTime

type ChannelTime = struct {
	Channel   ChannelId `ic:"chanid"`
	Timestamp Timestamp `ic:"time"`
}

type Duration

type Duration = uint64

type Error

type Error = string

type Event

type Event = struct {
	// contains filtered or unexported fields
}

type EventTxt

type EventTxt = string

type FullySignedState

type FullySignedState = struct {
	State State    `ic:"state"`
	Sigs  [][]byte `ic:"sigs"`
}

type FundMem

type FundMem = struct {
	Channel     ChannelId `ic:"channel"`
	Participant L2Account `ic:"participant"`
	Memo        uint64    `ic:"memo"`
}

type Funding

type Funding = struct {
	Channel     ChannelId `ic:"channel"`
	Participant L2Account `ic:"participant"`
}

type Hash

type Hash = []uint8

type L2Account

type L2Account = []uint8

type Nonce

type Nonce = [32]byte

type Params

type Params = struct {
	Nonce             Nonce       `ic:"nonce"`
	Participants      []L2Account `ic:"participants"`
	ChallengeDuration Duration    `ic:"challenge_duration"`
}

type RegisteredState

type RegisteredState = struct {
	State   State     `ic:"state"`
	Timeout Timestamp `ic:"timeout"`
}

type Signature

type Signature = Hash

type State

type State = struct {
	Channel    ChannelId `ic:"channel"`
	Version    uint64    `ic:"version"`
	Allocation []Amount  `ic:"allocation"`
	Finalized  bool      `ic:"finalized"`
}

type Timestamp

type Timestamp = uint64

type WithdrawalRequest

type WithdrawalRequest = struct {
	Channel     ChannelId           `ic:"channel"`
	Participant L2Account           `ic:"participant"`
	Receiver    principal.Principal `ic:"receiver"`
	Sig         Signature           `ic:"signature"`
	Timestamp   Timestamp           `ic:"time"`
}

Jump to

Keyboard shortcuts

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