cadence

package module
v0.39.13-stable-cadence Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 16 Imported by: 327

README

CI

Cadence

Introduction

Cadence is a resource-oriented programming language that introduces new features to smart contract programming that help developers ensure that their code is safe, secure, clear, and approachable.

Some of these features are:

  • Type safety and a strong static type system
  • Resource-oriented programming, a new paradigm that pairs linear types with object capabilities to create a secure and declarative model for digital ownership by ensuring that resources (and their associated assets) can only exist in one location at a time, cannot be copied, and cannot be accidentally lost or deleted
  • Built-in pre-conditions and post-conditions for functions and transactions
  • The utilization of capability-based security, which enforces access control by requiring that access to objects is restricted to only the owner and those who have a valid reference to the object

Getting Started

To get started writing Cadence, why not try out the Playground?

If you want to develop locally, use these tools:

  • Flow CLI, which includes the Flow emulator. The emulator is a lightweight tool that emulates the behaviour of the real Flow network.
  • Visual Studio Code extension. The Visual Studio Code extension enables the development, deployment of, and interaction with Cadence contracts.

Documentation

Check out the Cadence Docs.

Contributing

If you would like to contribute to Cadence, have a look at the contributing guide.

Development documentation can be found in the /docs directory. For example, it contains the source for the language reference.

Documentation

Index

Constants

View Source
const AddressLength = 8
View Source
const Version = "v0.39.13-stable-cadence"

Variables

View Source
var Int128MemoryUsage = common.NewCadenceBigIntMemoryUsage(16)
View Source
var Int256MemoryUsage = common.NewCadenceBigIntMemoryUsage(32)
View Source
var TheAccountKeyType = AccountKeyType{}
View Source
var TheAddressType = AddressType{}
View Source
var TheAnyResourceAttachmentType = AnyResourceAttachmentType{}
View Source
var TheAnyResourceType = AnyResourceType{}
View Source
var TheAnyStructAttachmentType = AnyStructAttachmentType{}
View Source
var TheAnyStructType = AnyStructType{}
View Source
var TheAnyType = AnyType{}
View Source
var TheAuthAccountContractsType = AuthAccountContractsType{}
View Source
var TheAuthAccountKeysType = AuthAccountKeysType{}
View Source
var TheAuthAccountType = AuthAccountType{}
View Source
var TheBlockType = BlockType{}
View Source
var TheBoolType = BoolType{}
View Source
var TheBytesType = BytesType{}
View Source
var TheCapabilityPathType = CapabilityPathType{}
View Source
var TheCharacterType = CharacterType{}
View Source
var TheDeployedContractType = DeployedContractType{}
View Source
var TheFix64Type = Fix64Type{}
View Source
var TheFixedPointType = FixedPointType{}
View Source
var TheInt128Type = Int128Type{}
View Source
var TheInt16Type = Int16Type{}
View Source
var TheInt256Type = Int256Type{}
View Source
var TheInt32Type = Int32Type{}
View Source
var TheInt64Type = Int64Type{}
View Source
var TheInt8Type = Int8Type{}
View Source
var TheIntType = IntType{}
View Source
var TheIntegerType = IntegerType{}
View Source
var TheMetaType = MetaType{}
View Source
var TheNeverType = NeverType{}
View Source
var TheNumberType = NumberType{}
View Source
var ThePathType = PathType{}
View Source
var ThePrivatePathType = PrivatePathType{}
View Source
var ThePublicAccountContractsType = PublicAccountContractsType{}
View Source
var ThePublicAccountKeysType = PublicAccountKeysType{}
View Source
var ThePublicAccountType = PublicAccountType{}
View Source
var ThePublicPathType = PublicPathType{}
View Source
var TheSignedFixedPointType = SignedFixedPointType{}
View Source
var TheSignedIntegerType = SignedIntegerType{}
View Source
var TheSignedNumberType = SignedNumberType{}
View Source
var TheStoragePathType = StoragePathType{}
View Source
var TheStringType = StringType{}
View Source
var TheUFix64Type = UFix64Type{}
View Source
var TheUInt128Type = UInt128Type{}
View Source
var TheUInt16Type = UInt16Type{}
View Source
var TheUInt256Type = UInt256Type{}
View Source
var TheUInt32Type = UInt32Type{}
View Source
var TheUInt64Type = UInt64Type{}
View Source
var TheUInt8Type = UInt8Type{}
View Source
var TheUIntType = UIntType{}
View Source
var TheVoidType = VoidType{}
View Source
var TheWord128Type = Word128Type{}
View Source
var TheWord16Type = Word16Type{}
View Source
var TheWord256Type = Word256Type{}
View Source
var TheWord32Type = Word32Type{}
View Source
var TheWord64Type = Word64Type{}
View Source
var TheWord8Type = Word8Type{}
View Source
var UInt128MemoryUsage = common.NewCadenceBigIntMemoryUsage(16)
View Source
var UInt256MemoryUsage = common.NewCadenceBigIntMemoryUsage(32)
View Source
var Word128MemoryUsage = common.NewCadenceBigIntMemoryUsage(16)
View Source
var Word256MemoryUsage = common.NewCadenceBigIntMemoryUsage(32)

Functions

func CastToArray

func CastToArray(value Value) ([]any, error)

func CastToInt

func CastToInt(value Value) (int, error)

func CastToString

func CastToString(value Value) (string, error)

func CastToUInt16

func CastToUInt16(value Value) (uint16, error)

func CastToUInt8

func CastToUInt8(value Value) (uint8, error)

func DecodeFields added in v0.39.10

func DecodeFields(hasFields HasFields, s interface{}) error

DecodeFields decodes a HasFields into a struct

func Fuzz

func Fuzz(data []byte) int

func GetFieldsMappedByName added in v0.39.6

func GetFieldsMappedByName(v HasFields) map[string]Value

func ParseUFix64 added in v0.24.0

func ParseUFix64(s string) (uint64, error)

func ValueWithCachedTypeID added in v0.35.0

func ValueWithCachedTypeID[T Value](value T) T

ValueWithCachedTypeID recursively caches type ID of value v's type. This is needed because each type ID is lazily cached on its first use in ID() to avoid performance penalty.

Types

type AccountKeyType added in v0.24.0

type AccountKeyType struct{}

AccountKeyType

func NewAccountKeyType added in v0.24.0

func NewAccountKeyType() AccountKeyType

func (AccountKeyType) Equal added in v0.31.1

func (t AccountKeyType) Equal(other Type) bool

func (AccountKeyType) ID added in v0.24.0

func (AccountKeyType) ID() string
type AccountLink struct{}
func NewAccountLink() AccountLink
func NewMeteredAccountLink(gauge common.MemoryGauge) AccountLink

func (AccountLink) MeteredType added in v0.39.0

func (v AccountLink) MeteredType(_ common.MemoryGauge) Type

func (AccountLink) String added in v0.39.0

func (v AccountLink) String() string

func (AccountLink) ToGoValue added in v0.39.0

func (v AccountLink) ToGoValue() any

func (AccountLink) Type added in v0.39.0

func (v AccountLink) Type() Type

type Address

type Address [AddressLength]byte

func BytesToAddress

func BytesToAddress(b []byte) Address

func BytesToMeteredAddress added in v0.24.0

func BytesToMeteredAddress(memoryGauge common.MemoryGauge, b []byte) Address

func NewAddress

func NewAddress(b [AddressLength]byte) Address

func NewMeteredAddress added in v0.24.0

func NewMeteredAddress(memoryGauge common.MemoryGauge, b [AddressLength]byte) Address

func (Address) Bytes

func (v Address) Bytes() []byte

func (Address) Hex

func (v Address) Hex() string

func (Address) MeteredType added in v0.24.0

func (Address) MeteredType(common.MemoryGauge) Type

func (Address) String

func (v Address) String() string

func (Address) ToGoValue

func (v Address) ToGoValue() any

func (Address) Type

func (Address) Type() Type

type AddressType

type AddressType struct{}

func NewAddressType added in v0.24.0

func NewAddressType() AddressType

func (AddressType) Equal added in v0.31.1

func (t AddressType) Equal(other Type) bool

func (AddressType) ID

func (AddressType) ID() string

type AnyResourceAttachmentType added in v0.36.0

type AnyResourceAttachmentType struct{}

func NewAnyResourceAttachmentType added in v0.36.0

func NewAnyResourceAttachmentType() AnyResourceAttachmentType

func (AnyResourceAttachmentType) Equal added in v0.36.0

func (t AnyResourceAttachmentType) Equal(other Type) bool

func (AnyResourceAttachmentType) ID added in v0.36.0

type AnyResourceType

type AnyResourceType struct{}

func NewAnyResourceType added in v0.24.0

func NewAnyResourceType() AnyResourceType

func (AnyResourceType) Equal added in v0.31.1

func (t AnyResourceType) Equal(other Type) bool

func (AnyResourceType) ID

func (AnyResourceType) ID() string

type AnyStructAttachmentType added in v0.36.0

type AnyStructAttachmentType struct{}

func NewAnyStructAttachmentType added in v0.36.0

func NewAnyStructAttachmentType() AnyStructAttachmentType

func (AnyStructAttachmentType) Equal added in v0.36.0

func (t AnyStructAttachmentType) Equal(other Type) bool

func (AnyStructAttachmentType) ID added in v0.36.0

type AnyStructType

type AnyStructType struct{}

func NewAnyStructType added in v0.24.0

func NewAnyStructType() AnyStructType

func (AnyStructType) Equal added in v0.31.1

func (t AnyStructType) Equal(other Type) bool

func (AnyStructType) ID

func (AnyStructType) ID() string

type AnyType

type AnyType struct{}

func NewAnyType added in v0.24.0

func NewAnyType() AnyType

func (AnyType) Equal added in v0.31.1

func (t AnyType) Equal(other Type) bool

func (AnyType) ID

func (AnyType) ID() string

type Array

type Array struct {
	ArrayType ArrayType
	Values    []Value
}

func NewArray

func NewArray(values []Value) Array

func NewMeteredArray added in v0.24.0

func NewMeteredArray(
	gauge common.MemoryGauge,
	length int,
	constructor func() ([]Value, error),
) (Array, error)

func (Array) MeteredType added in v0.24.0

func (v Array) MeteredType(common.MemoryGauge) Type

func (Array) String added in v0.12.0

func (v Array) String() string

func (Array) ToGoValue

func (v Array) ToGoValue() any

func (Array) Type

func (v Array) Type() Type

func (Array) WithType added in v0.19.0

func (v Array) WithType(arrayType ArrayType) Array

type ArrayType

type ArrayType interface {
	Type
	Element() Type
}

type Attachment added in v0.36.0

type Attachment struct {
	AttachmentType *AttachmentType
	Fields         []Value
}

func NewAttachment added in v0.36.0

func NewAttachment(fields []Value) Attachment

func NewMeteredAttachment added in v0.36.0

func NewMeteredAttachment(
	gauge common.MemoryGauge,
	numberOfFields int,
	constructor func() ([]Value, error),
) (Attachment, error)

func (Attachment) GetFieldValues added in v0.39.6

func (v Attachment) GetFieldValues() []Value

func (Attachment) GetFields added in v0.39.6

func (v Attachment) GetFields() []Field

func (Attachment) MeteredType added in v0.36.0

func (v Attachment) MeteredType(_ common.MemoryGauge) Type

func (Attachment) String added in v0.36.0

func (v Attachment) String() string

func (Attachment) ToGoValue added in v0.36.0

func (v Attachment) ToGoValue() any

func (Attachment) Type added in v0.36.0

func (v Attachment) Type() Type

func (Attachment) WithType added in v0.36.0

func (v Attachment) WithType(typ *AttachmentType) Attachment

type AttachmentType added in v0.36.0

type AttachmentType struct {
	Location            common.Location
	BaseType            Type
	QualifiedIdentifier string
	Fields              []Field
	Initializers        [][]Parameter
}

AttachmentType

func NewAttachmentType added in v0.36.0

func NewAttachmentType(
	location common.Location,
	baseType Type,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *AttachmentType

func NewMeteredAttachmentType added in v0.36.0

func NewMeteredAttachmentType(
	gauge common.MemoryGauge,
	location common.Location,
	baseType Type,
	qualifiedIdentifer string,
	fields []Field,
	initializers [][]Parameter,
) *AttachmentType

func (*AttachmentType) Base added in v0.36.0

func (t *AttachmentType) Base() Type

func (*AttachmentType) CompositeFields added in v0.36.0

func (t *AttachmentType) CompositeFields() []Field

func (*AttachmentType) CompositeInitializers added in v0.36.0

func (t *AttachmentType) CompositeInitializers() [][]Parameter

func (*AttachmentType) CompositeTypeLocation added in v0.36.0

func (t *AttachmentType) CompositeTypeLocation() common.Location

func (*AttachmentType) CompositeTypeQualifiedIdentifier added in v0.36.0

func (t *AttachmentType) CompositeTypeQualifiedIdentifier() string

func (*AttachmentType) Equal added in v0.36.0

func (t *AttachmentType) Equal(other Type) bool

func (*AttachmentType) ID added in v0.36.0

func (t *AttachmentType) ID() string

func (*AttachmentType) SetCompositeFields added in v0.36.0

func (t *AttachmentType) SetCompositeFields(fields []Field)

type AuthAccountContractsType added in v0.24.0

type AuthAccountContractsType struct{}

AuthAccountContractsType

func NewAuthAccountContractsType added in v0.24.0

func NewAuthAccountContractsType() AuthAccountContractsType

func (AuthAccountContractsType) Equal added in v0.31.1

func (t AuthAccountContractsType) Equal(other Type) bool

func (AuthAccountContractsType) ID added in v0.24.0

type AuthAccountKeysType added in v0.24.0

type AuthAccountKeysType struct{}

AuthAccountKeysType

func NewAuthAccountKeysType added in v0.24.0

func NewAuthAccountKeysType() AuthAccountKeysType

func (AuthAccountKeysType) Equal added in v0.31.1

func (t AuthAccountKeysType) Equal(other Type) bool

func (AuthAccountKeysType) ID added in v0.24.0

type AuthAccountType added in v0.7.0

type AuthAccountType struct{}

AuthAccountType

func NewAuthAccountType added in v0.24.0

func NewAuthAccountType() AuthAccountType

func (AuthAccountType) Equal added in v0.31.1

func (t AuthAccountType) Equal(other Type) bool

func (AuthAccountType) ID added in v0.7.0

func (AuthAccountType) ID() string

type Authorization added in v1.0.0

type Authorization interface {
	ID() string
	Equal(auth Authorization) bool
	// contains filtered or unexported methods
}
var UnauthorizedAccess Authorization = Unauthorized{}

type BlockType added in v0.7.0

type BlockType struct{}

func NewBlockType added in v0.24.0

func NewBlockType() BlockType

func (BlockType) Equal added in v0.31.1

func (t BlockType) Equal(other Type) bool

func (BlockType) ID added in v0.7.0

func (BlockType) ID() string

type Bool

type Bool bool

func NewBool

func NewBool(b bool) Bool

func NewMeteredBool added in v0.24.0

func NewMeteredBool(memoryGauge common.MemoryGauge, b bool) Bool

func (Bool) MeteredType added in v0.24.0

func (v Bool) MeteredType(common.MemoryGauge) Type

func (Bool) String added in v0.12.0

func (v Bool) String() string

func (Bool) ToGoValue

func (v Bool) ToGoValue() any

func (Bool) Type

func (Bool) Type() Type

type BoolType

type BoolType struct{}

func NewBoolType added in v0.24.0

func NewBoolType() BoolType

func (BoolType) Equal added in v0.31.1

func (t BoolType) Equal(other Type) bool

func (BoolType) ID

func (BoolType) ID() string

type Bytes

type Bytes []byte

func NewBytes

func NewBytes(b []byte) Bytes

Unmetered because this is only used by cadence in tests

func (Bytes) MeteredType added in v0.24.0

func (v Bytes) MeteredType(common.MemoryGauge) Type

func (Bytes) String added in v0.12.0

func (v Bytes) String() string

func (Bytes) ToGoValue

func (v Bytes) ToGoValue() any

func (Bytes) Type

func (Bytes) Type() Type

type BytesType

type BytesType struct{}

func NewBytesType added in v0.24.0

func NewBytesType() BytesType

func (BytesType) Equal added in v0.31.1

func (t BytesType) Equal(other Type) bool

func (BytesType) ID

func (BytesType) ID() string

type Capability added in v0.10.0

type Capability interface {
	Value
	// contains filtered or unexported methods
}

type CapabilityPathType added in v0.11.0

type CapabilityPathType struct{}

func NewCapabilityPathType added in v0.24.0

func NewCapabilityPathType() CapabilityPathType

func (CapabilityPathType) Equal added in v0.31.1

func (t CapabilityPathType) Equal(other Type) bool

func (CapabilityPathType) ID added in v0.11.0

type CapabilityType added in v0.7.0

type CapabilityType struct {
	BorrowType Type
	// contains filtered or unexported fields
}

func NewCapabilityType added in v0.24.0

func NewCapabilityType(borrowType Type) *CapabilityType

func NewMeteredCapabilityType added in v0.24.0

func NewMeteredCapabilityType(
	gauge common.MemoryGauge,
	borrowType Type,
) *CapabilityType

func (*CapabilityType) Equal added in v0.31.1

func (t *CapabilityType) Equal(other Type) bool

func (*CapabilityType) ID added in v0.7.0

func (t *CapabilityType) ID() string

type Character added in v0.24.0

type Character string

Character represents a Cadence character, which is a Unicode extended grapheme cluster. Hence, use a Go string to be able to hold multiple Unicode code points (Go runes). It should consist of exactly one grapheme cluster

func NewCharacter added in v0.24.0

func NewCharacter(b string) (Character, error)

func NewMeteredCharacter added in v0.24.0

func NewMeteredCharacter(
	memoryGauge common.MemoryGauge,
	memoryUsage common.MemoryUsage,
	stringConstructor func() string,
) (Character, error)

func (Character) MeteredType added in v0.24.0

func (v Character) MeteredType(common.MemoryGauge) Type

func (Character) String added in v0.24.0

func (v Character) String() string

func (Character) ToGoValue added in v0.24.0

func (v Character) ToGoValue() any

func (Character) Type added in v0.24.0

func (Character) Type() Type

type CharacterType added in v0.7.0

type CharacterType struct{}

func NewCharacterType added in v0.24.0

func NewCharacterType() CharacterType

func (CharacterType) Equal added in v0.31.1

func (t CharacterType) Equal(other Type) bool

func (CharacterType) ID added in v0.7.0

func (CharacterType) ID() string

type CompositeType

type CompositeType interface {
	Type

	CompositeTypeLocation() common.Location
	CompositeTypeQualifiedIdentifier() string
	CompositeFields() []Field
	SetCompositeFields([]Field)
	CompositeInitializers() [][]Parameter
	// contains filtered or unexported methods
}

type ConstantSizedArrayType

type ConstantSizedArrayType struct {
	ElementType Type
	Size        uint
	// contains filtered or unexported fields
}

func NewConstantSizedArrayType added in v0.24.0

func NewConstantSizedArrayType(
	size uint,
	elementType Type,
) *ConstantSizedArrayType

func NewMeteredConstantSizedArrayType added in v0.24.0

func NewMeteredConstantSizedArrayType(
	gauge common.MemoryGauge,
	size uint,
	elementType Type,
) *ConstantSizedArrayType

func (*ConstantSizedArrayType) Element

func (t *ConstantSizedArrayType) Element() Type

func (*ConstantSizedArrayType) Equal added in v0.31.1

func (t *ConstantSizedArrayType) Equal(other Type) bool

func (*ConstantSizedArrayType) ID

type Contract added in v0.6.0

type Contract struct {
	ContractType *ContractType
	Fields       []Value
}

func NewContract added in v0.6.0

func NewContract(fields []Value) Contract

func NewMeteredContract added in v0.24.0

func NewMeteredContract(
	gauge common.MemoryGauge,
	numberOfFields int,
	constructor func() ([]Value, error),
) (Contract, error)

func (Contract) GetFieldValues added in v0.39.6

func (v Contract) GetFieldValues() []Value

func (Contract) GetFields added in v0.39.6

func (v Contract) GetFields() []Field

func (Contract) MeteredType added in v0.24.0

func (v Contract) MeteredType(common.MemoryGauge) Type

func (Contract) String added in v0.12.0

func (v Contract) String() string

func (Contract) ToGoValue added in v0.6.0

func (v Contract) ToGoValue() any

func (Contract) Type added in v0.6.0

func (v Contract) Type() Type

func (Contract) WithType added in v0.6.0

func (v Contract) WithType(typ *ContractType) Contract

type ContractInterfaceType added in v0.7.0

type ContractInterfaceType struct {
	Location            common.Location
	QualifiedIdentifier string
	Fields              []Field
	Initializers        [][]Parameter
	// contains filtered or unexported fields
}

func NewContractInterfaceType added in v0.24.0

func NewContractInterfaceType(
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *ContractInterfaceType

func NewMeteredContractInterfaceType added in v0.24.0

func NewMeteredContractInterfaceType(
	gauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *ContractInterfaceType

func (*ContractInterfaceType) Equal added in v0.31.1

func (t *ContractInterfaceType) Equal(other Type) bool

func (*ContractInterfaceType) ID added in v0.7.0

func (t *ContractInterfaceType) ID() string

func (*ContractInterfaceType) InterfaceFields added in v0.7.0

func (t *ContractInterfaceType) InterfaceFields() []Field

func (*ContractInterfaceType) InterfaceInitializers added in v0.7.0

func (t *ContractInterfaceType) InterfaceInitializers() [][]Parameter

func (*ContractInterfaceType) InterfaceTypeLocation added in v0.12.0

func (t *ContractInterfaceType) InterfaceTypeLocation() common.Location

func (*ContractInterfaceType) InterfaceTypeQualifiedIdentifier added in v0.12.0

func (t *ContractInterfaceType) InterfaceTypeQualifiedIdentifier() string

func (*ContractInterfaceType) SetInterfaceFields added in v0.24.3

func (t *ContractInterfaceType) SetInterfaceFields(fields []Field)

type ContractType added in v0.6.0

type ContractType struct {
	Location            common.Location
	QualifiedIdentifier string
	Fields              []Field
	Initializers        [][]Parameter
	// contains filtered or unexported fields
}

func NewContractType added in v0.24.0

func NewContractType(
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *ContractType

func NewMeteredContractType added in v0.24.0

func NewMeteredContractType(
	gauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *ContractType

func (*ContractType) CompositeFields added in v0.6.0

func (t *ContractType) CompositeFields() []Field

func (*ContractType) CompositeInitializers added in v0.6.0

func (t *ContractType) CompositeInitializers() [][]Parameter

func (*ContractType) CompositeTypeLocation added in v0.12.0

func (t *ContractType) CompositeTypeLocation() common.Location

func (*ContractType) CompositeTypeQualifiedIdentifier added in v0.12.0

func (t *ContractType) CompositeTypeQualifiedIdentifier() string

func (*ContractType) Equal added in v0.31.1

func (t *ContractType) Equal(other Type) bool

func (*ContractType) ID added in v0.6.0

func (t *ContractType) ID() string

func (*ContractType) SetCompositeFields added in v0.24.3

func (t *ContractType) SetCompositeFields(fields []Field)

type DeployedContractType added in v0.24.0

type DeployedContractType struct{}

DeployedContractType

func NewDeployedContractType added in v0.24.0

func NewDeployedContractType() DeployedContractType

func (DeployedContractType) Equal added in v0.31.1

func (t DeployedContractType) Equal(other Type) bool

func (DeployedContractType) ID added in v0.24.0

type Dictionary

type Dictionary struct {
	DictionaryType *DictionaryType
	Pairs          []KeyValuePair
}

func NewDictionary

func NewDictionary(pairs []KeyValuePair) Dictionary

func NewMeteredDictionary added in v0.24.0

func NewMeteredDictionary(
	gauge common.MemoryGauge,
	size int,
	constructor func() ([]KeyValuePair, error),
) (Dictionary, error)

func (Dictionary) MeteredType added in v0.24.0

func (v Dictionary) MeteredType(common.MemoryGauge) Type

func (Dictionary) String added in v0.12.0

func (v Dictionary) String() string

func (Dictionary) ToGoValue

func (v Dictionary) ToGoValue() any

func (Dictionary) Type

func (v Dictionary) Type() Type

func (Dictionary) WithType added in v0.19.0

func (v Dictionary) WithType(dictionaryType *DictionaryType) Dictionary

type DictionaryType

type DictionaryType struct {
	KeyType     Type
	ElementType Type
	// contains filtered or unexported fields
}

func NewDictionaryType added in v0.24.0

func NewDictionaryType(
	keyType Type,
	elementType Type,
) *DictionaryType

func NewMeteredDictionaryType added in v0.24.0

func NewMeteredDictionaryType(
	gauge common.MemoryGauge,
	keyType Type,
	elementType Type,
) *DictionaryType

func (*DictionaryType) Equal added in v0.31.1

func (t *DictionaryType) Equal(other Type) bool

func (*DictionaryType) ID

func (t *DictionaryType) ID() string

type EntitlementMapAuthorization added in v1.0.0

type EntitlementMapAuthorization struct {
	TypeID common.TypeID
}

func NewEntitlementMapAuthorization added in v1.0.0

func NewEntitlementMapAuthorization(gauge common.MemoryGauge, id common.TypeID) EntitlementMapAuthorization

func (EntitlementMapAuthorization) Equal added in v1.0.0

func (EntitlementMapAuthorization) ID added in v1.0.0

type EntitlementSetAuthorization added in v1.0.0

type EntitlementSetAuthorization struct {
	Entitlements []common.TypeID
	Kind         EntitlementSetKind
}

func NewEntitlementSetAuthorization added in v1.0.0

func NewEntitlementSetAuthorization(gauge common.MemoryGauge, entitlements []common.TypeID, kind EntitlementSetKind) EntitlementSetAuthorization

func (EntitlementSetAuthorization) Equal added in v1.0.0

func (EntitlementSetAuthorization) ID added in v1.0.0

type EntitlementSetKind added in v1.0.0

type EntitlementSetKind uint8
const (
	Conjunction EntitlementSetKind = iota
	Disjunction
)

type Enum added in v0.14.0

type Enum struct {
	EnumType *EnumType
	Fields   []Value
}

Enum

func NewEnum added in v0.14.0

func NewEnum(fields []Value) Enum

func NewMeteredEnum added in v0.24.0

func NewMeteredEnum(
	gauge common.MemoryGauge,
	numberOfFields int,
	constructor func() ([]Value, error),
) (Enum, error)

func (Enum) GetFieldValues added in v0.39.6

func (v Enum) GetFieldValues() []Value

func (Enum) GetFields added in v0.39.6

func (v Enum) GetFields() []Field

func (Enum) MeteredType added in v0.24.0

func (v Enum) MeteredType(common.MemoryGauge) Type

func (Enum) String added in v0.14.0

func (v Enum) String() string

func (Enum) ToGoValue added in v0.14.0

func (v Enum) ToGoValue() any

func (Enum) Type added in v0.14.0

func (v Enum) Type() Type

func (Enum) WithType added in v0.14.0

func (v Enum) WithType(typ *EnumType) Enum

type EnumType added in v0.14.0

type EnumType struct {
	Location            common.Location
	QualifiedIdentifier string
	RawType             Type
	Fields              []Field
	Initializers        [][]Parameter
	// contains filtered or unexported fields
}

EnumType

func NewEnumType added in v0.24.0

func NewEnumType(
	location common.Location,
	qualifiedIdentifier string,
	rawType Type,
	fields []Field,
	initializers [][]Parameter,
) *EnumType

func NewMeteredEnumType added in v0.24.0

func NewMeteredEnumType(
	gauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	rawType Type,
	fields []Field,
	initializers [][]Parameter,
) *EnumType

func (*EnumType) CompositeFields added in v0.14.0

func (t *EnumType) CompositeFields() []Field

func (*EnumType) CompositeInitializers added in v0.14.0

func (t *EnumType) CompositeInitializers() [][]Parameter

func (*EnumType) CompositeTypeLocation added in v0.14.0

func (t *EnumType) CompositeTypeLocation() common.Location

func (*EnumType) CompositeTypeQualifiedIdentifier added in v0.14.0

func (t *EnumType) CompositeTypeQualifiedIdentifier() string

func (*EnumType) Equal added in v0.31.1

func (t *EnumType) Equal(other Type) bool

func (*EnumType) ID added in v0.14.0

func (t *EnumType) ID() string

func (*EnumType) SetCompositeFields added in v0.24.3

func (t *EnumType) SetCompositeFields(fields []Field)

type Event

type Event struct {
	EventType *EventType
	Fields    []Value
}

func NewEvent

func NewEvent(fields []Value) Event

func NewMeteredEvent added in v0.24.0

func NewMeteredEvent(
	gauge common.MemoryGauge,
	numberOfFields int,
	constructor func() ([]Value, error),
) (Event, error)

func (Event) GetFieldValues added in v0.39.6

func (v Event) GetFieldValues() []Value

func (Event) GetFields added in v0.39.6

func (v Event) GetFields() []Field

func (Event) MeteredType added in v0.24.0

func (v Event) MeteredType(common.MemoryGauge) Type

func (Event) String added in v0.12.0

func (v Event) String() string

func (Event) ToGoValue

func (v Event) ToGoValue() any

func (Event) Type

func (v Event) Type() Type

func (Event) WithType

func (v Event) WithType(typ *EventType) Event

type EventType

type EventType struct {
	Location            common.Location
	QualifiedIdentifier string
	Fields              []Field
	Initializer         []Parameter
	// contains filtered or unexported fields
}

func NewEventType added in v0.24.0

func NewEventType(
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializer []Parameter,
) *EventType

func NewMeteredEventType added in v0.24.0

func NewMeteredEventType(
	gauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializer []Parameter,
) *EventType

func (*EventType) CompositeFields

func (t *EventType) CompositeFields() []Field

func (*EventType) CompositeInitializers

func (t *EventType) CompositeInitializers() [][]Parameter

func (*EventType) CompositeTypeLocation added in v0.12.0

func (t *EventType) CompositeTypeLocation() common.Location

func (*EventType) CompositeTypeQualifiedIdentifier added in v0.12.0

func (t *EventType) CompositeTypeQualifiedIdentifier() string

func (*EventType) Equal added in v0.31.1

func (t *EventType) Equal(other Type) bool

func (*EventType) ID

func (t *EventType) ID() string

func (*EventType) SetCompositeFields added in v0.24.3

func (t *EventType) SetCompositeFields(fields []Field)

type Field

type Field struct {
	Type       Type
	Identifier string
}

func NewField added in v0.24.0

func NewField(identifier string, typ Type) Field

Fields are always created in an array, which must be metered ahead of time. So no metering here.

type Fix64

type Fix64 int64

func NewFix64

func NewFix64(s string) (Fix64, error)

func NewFix64FromParts added in v0.5.0

func NewFix64FromParts(negative bool, integer int, fraction uint) (Fix64, error)

func NewMeteredFix64 added in v0.24.0

func NewMeteredFix64(gauge common.MemoryGauge, constructor func() (string, error)) (Fix64, error)

func NewMeteredFix64FromRawFixedPointNumber added in v0.39.0

func NewMeteredFix64FromRawFixedPointNumber(gauge common.MemoryGauge, n int64) (Fix64, error)

func (Fix64) MeteredType added in v0.24.0

func (v Fix64) MeteredType(common.MemoryGauge) Type

func (Fix64) String added in v0.12.0

func (v Fix64) String() string

func (Fix64) ToBigEndianBytes added in v0.5.0

func (v Fix64) ToBigEndianBytes() []byte

func (Fix64) ToGoValue

func (v Fix64) ToGoValue() any

func (Fix64) Type

func (Fix64) Type() Type

type Fix64Type

type Fix64Type struct{}

func NewFix64Type added in v0.24.0

func NewFix64Type() Fix64Type

func (Fix64Type) Equal added in v0.31.1

func (t Fix64Type) Equal(other Type) bool

func (Fix64Type) ID

func (Fix64Type) ID() string

type FixedPointType added in v0.7.0

type FixedPointType struct{}

func NewFixedPointType added in v0.24.0

func NewFixedPointType() FixedPointType

func (FixedPointType) Equal added in v0.31.1

func (t FixedPointType) Equal(other Type) bool

func (FixedPointType) ID added in v0.7.0

func (FixedPointType) ID() string

type Function

type Function struct {
	FunctionType *FunctionType
}

Function

func NewFunction added in v0.30.0

func NewFunction(functionType *FunctionType) Function

func NewMeteredFunction added in v0.30.0

func NewMeteredFunction(gauge common.MemoryGauge, functionType *FunctionType) Function

func (Function) MeteredType added in v0.30.0

func (v Function) MeteredType(common.MemoryGauge) Type

func (Function) String added in v0.30.0

func (v Function) String() string

func (Function) ToGoValue added in v0.30.0

func (Function) ToGoValue() any

func (Function) Type added in v0.30.0

func (v Function) Type() Type

type FunctionPurity added in v0.32.0

type FunctionPurity int
const (
	FunctionPurityUnspecified FunctionPurity = iota
	FunctionPurityView
)

type FunctionType added in v0.24.0

type FunctionType struct {
	TypeParameters []TypeParameter
	Parameters     []Parameter
	ReturnType     Type
	Purity         FunctionPurity
	// contains filtered or unexported fields
}

func NewFunctionType added in v0.24.0

func NewFunctionType(
	purity FunctionPurity,
	typeParameters []TypeParameter,
	parameters []Parameter,
	returnType Type,
) *FunctionType

func NewMeteredFunctionType added in v0.24.0

func NewMeteredFunctionType(
	gauge common.MemoryGauge,
	purity FunctionPurity,
	typeParameters []TypeParameter,
	parameters []Parameter,
	returnType Type,
) *FunctionType

func (*FunctionType) Equal added in v0.31.1

func (t *FunctionType) Equal(other Type) bool

func (*FunctionType) ID added in v0.24.0

func (t *FunctionType) ID() string

type HasFields added in v0.39.6

type HasFields interface {
	GetFields() []Field
	GetFieldValues() []Value
}

type IDCapability added in v0.39.0

type IDCapability struct {
	BorrowType Type
	Address    Address
	ID         UInt64
}

func NewIDCapability added in v0.39.0

func NewIDCapability(
	id UInt64,
	address Address,
	borrowType Type,
) IDCapability

func NewMeteredIDCapability added in v0.39.0

func NewMeteredIDCapability(
	gauge common.MemoryGauge,
	id UInt64,
	address Address,
	borrowType Type,
) IDCapability

func (IDCapability) MeteredType added in v0.39.0

func (v IDCapability) MeteredType(gauge common.MemoryGauge) Type

func (IDCapability) String added in v0.39.0

func (v IDCapability) String() string

func (IDCapability) ToGoValue added in v0.39.0

func (IDCapability) ToGoValue() any

func (IDCapability) Type added in v0.39.0

func (v IDCapability) Type() Type

type Int

type Int struct {
	Value *big.Int
}

func NewInt

func NewInt(i int) Int

func NewIntFromBig

func NewIntFromBig(i *big.Int) Int

func NewMeteredIntFromBig added in v0.24.0

func NewMeteredIntFromBig(
	memoryGauge common.MemoryGauge,
	memoryUsage common.MemoryUsage,
	bigIntConstructor func() *big.Int,
) Int

func (Int) Big

func (v Int) Big() *big.Int

func (Int) Int

func (v Int) Int() int

func (Int) MeteredType added in v0.24.0

func (v Int) MeteredType(common.MemoryGauge) Type

func (Int) String added in v0.12.0

func (v Int) String() string

func (Int) ToBigEndianBytes added in v0.5.0

func (v Int) ToBigEndianBytes() []byte

func (Int) ToGoValue

func (v Int) ToGoValue() any

func (Int) Type

func (Int) Type() Type

type Int128

type Int128 struct {
	Value *big.Int
}

func NewInt128

func NewInt128(i int) Int128

func NewInt128FromBig

func NewInt128FromBig(i *big.Int) (Int128, error)

func NewMeteredInt128FromBig added in v0.24.0

func NewMeteredInt128FromBig(
	memoryGauge common.MemoryGauge,
	bigIntConstructor func() *big.Int,
) (Int128, error)

func (Int128) Big

func (v Int128) Big() *big.Int

func (Int128) Int

func (v Int128) Int() int

func (Int128) MeteredType added in v0.24.0

func (v Int128) MeteredType(common.MemoryGauge) Type

func (Int128) String added in v0.12.0

func (v Int128) String() string

func (Int128) ToBigEndianBytes added in v0.5.0

func (v Int128) ToBigEndianBytes() []byte

func (Int128) ToGoValue

func (v Int128) ToGoValue() any

func (Int128) Type

func (Int128) Type() Type

type Int128Type

type Int128Type struct{}

func NewInt128Type added in v0.24.0

func NewInt128Type() Int128Type

func (Int128Type) Equal added in v0.31.1

func (t Int128Type) Equal(other Type) bool

func (Int128Type) ID

func (Int128Type) ID() string

type Int16

type Int16 int16

func NewInt16

func NewInt16(v int16) Int16

func NewMeteredInt16 added in v0.24.0

func NewMeteredInt16(memoryGauge common.MemoryGauge, v int16) Int16

func (Int16) MeteredType added in v0.24.0

func (v Int16) MeteredType(common.MemoryGauge) Type

func (Int16) String added in v0.12.0

func (v Int16) String() string

func (Int16) ToBigEndianBytes added in v0.5.0

func (v Int16) ToBigEndianBytes() []byte

func (Int16) ToGoValue

func (v Int16) ToGoValue() any

func (Int16) Type

func (Int16) Type() Type

type Int16Type

type Int16Type struct{}

func NewInt16Type added in v0.24.0

func NewInt16Type() Int16Type

func (Int16Type) Equal added in v0.31.1

func (t Int16Type) Equal(other Type) bool

func (Int16Type) ID

func (Int16Type) ID() string

type Int256

type Int256 struct {
	Value *big.Int
}

func NewInt256

func NewInt256(i int) Int256

func NewInt256FromBig

func NewInt256FromBig(i *big.Int) (Int256, error)

func NewMeteredInt256FromBig added in v0.24.0

func NewMeteredInt256FromBig(
	memoryGauge common.MemoryGauge,
	bigIntConstructor func() *big.Int,
) (Int256, error)

func (Int256) Big

func (v Int256) Big() *big.Int

func (Int256) Int

func (v Int256) Int() int

func (Int256) MeteredType added in v0.24.0

func (v Int256) MeteredType(common.MemoryGauge) Type

func (Int256) String added in v0.12.0

func (v Int256) String() string

func (Int256) ToBigEndianBytes added in v0.5.0

func (v Int256) ToBigEndianBytes() []byte

func (Int256) ToGoValue

func (v Int256) ToGoValue() any

func (Int256) Type

func (Int256) Type() Type

type Int256Type

type Int256Type struct{}

func NewInt256Type added in v0.24.0

func NewInt256Type() Int256Type

func (Int256Type) Equal added in v0.31.1

func (t Int256Type) Equal(other Type) bool

func (Int256Type) ID

func (Int256Type) ID() string

type Int32

type Int32 int32

func NewInt32

func NewInt32(v int32) Int32

func NewMeteredInt32 added in v0.24.0

func NewMeteredInt32(memoryGauge common.MemoryGauge, v int32) Int32

func (Int32) MeteredType added in v0.24.0

func (v Int32) MeteredType(common.MemoryGauge) Type

func (Int32) String added in v0.12.0

func (v Int32) String() string

func (Int32) ToBigEndianBytes added in v0.5.0

func (v Int32) ToBigEndianBytes() []byte

func (Int32) ToGoValue

func (v Int32) ToGoValue() any

func (Int32) Type

func (Int32) Type() Type

type Int32Type

type Int32Type struct{}

func NewInt32Type added in v0.24.0

func NewInt32Type() Int32Type

func (Int32Type) Equal added in v0.31.1

func (t Int32Type) Equal(other Type) bool

func (Int32Type) ID

func (Int32Type) ID() string

type Int64

type Int64 int64

func NewInt64

func NewInt64(i int64) Int64

func NewMeteredInt64 added in v0.24.0

func NewMeteredInt64(memoryGauge common.MemoryGauge, v int64) Int64

func (Int64) MeteredType added in v0.24.0

func (v Int64) MeteredType(common.MemoryGauge) Type

func (Int64) String added in v0.12.0

func (v Int64) String() string

func (Int64) ToBigEndianBytes added in v0.5.0

func (v Int64) ToBigEndianBytes() []byte

func (Int64) ToGoValue

func (v Int64) ToGoValue() any

func (Int64) Type

func (Int64) Type() Type

type Int64Type

type Int64Type struct{}

func NewInt64Type added in v0.24.0

func NewInt64Type() Int64Type

func (Int64Type) Equal added in v0.31.1

func (t Int64Type) Equal(other Type) bool

func (Int64Type) ID

func (Int64Type) ID() string

type Int8

type Int8 int8

func NewInt8

func NewInt8(v int8) Int8

func NewMeteredInt8 added in v0.24.0

func NewMeteredInt8(memoryGauge common.MemoryGauge, v int8) Int8

func (Int8) MeteredType added in v0.24.0

func (v Int8) MeteredType(common.MemoryGauge) Type

func (Int8) String added in v0.12.0

func (v Int8) String() string

func (Int8) ToBigEndianBytes added in v0.5.0

func (v Int8) ToBigEndianBytes() []byte

func (Int8) ToGoValue

func (v Int8) ToGoValue() any

func (Int8) Type

func (Int8) Type() Type

type Int8Type

type Int8Type struct{}

func NewInt8Type added in v0.24.0

func NewInt8Type() Int8Type

func (Int8Type) Equal added in v0.31.1

func (t Int8Type) Equal(other Type) bool

func (Int8Type) ID

func (Int8Type) ID() string

type IntType

type IntType struct{}

func NewIntType added in v0.24.0

func NewIntType() IntType

func (IntType) Equal added in v0.31.1

func (t IntType) Equal(other Type) bool

func (IntType) ID

func (IntType) ID() string

type IntegerType added in v0.7.0

type IntegerType struct{}

func NewIntegerType added in v0.24.0

func NewIntegerType() IntegerType

func (IntegerType) Equal added in v0.31.1

func (t IntegerType) Equal(other Type) bool

func (IntegerType) ID added in v0.7.0

func (IntegerType) ID() string

type InterfaceType added in v0.7.0

type InterfaceType interface {
	Type

	InterfaceTypeLocation() common.Location
	InterfaceTypeQualifiedIdentifier() string
	InterfaceFields() []Field
	SetInterfaceFields(fields []Field)
	InterfaceInitializers() [][]Parameter
	// contains filtered or unexported methods
}

type KeyValuePair

type KeyValuePair struct {
	Key   Value
	Value Value
}

func NewMeteredKeyValuePair added in v0.24.0

func NewMeteredKeyValuePair(gauge common.MemoryGauge, key, value Value) KeyValuePair

type MetaType added in v0.4.0

type MetaType struct{}

func NewMetaType added in v0.24.0

func NewMetaType() MetaType

func (MetaType) Equal added in v0.31.1

func (t MetaType) Equal(other Type) bool

func (MetaType) ID added in v0.4.0

func (MetaType) ID() string

type NeverType added in v0.7.0

type NeverType struct{}

func NewNeverType added in v0.24.0

func NewNeverType() NeverType

func (NeverType) Equal added in v0.31.1

func (t NeverType) Equal(other Type) bool

func (NeverType) ID added in v0.7.0

func (NeverType) ID() string

type NumberType added in v0.7.0

type NumberType struct{}

func NewNumberType added in v0.24.0

func NewNumberType() NumberType

func (NumberType) Equal added in v0.31.1

func (t NumberType) Equal(other Type) bool

func (NumberType) ID added in v0.7.0

func (NumberType) ID() string

type NumberValue added in v0.5.0

type NumberValue interface {
	Value
	ToBigEndianBytes() []byte
}

type Optional

type Optional struct {
	Value Value
}

func NewMeteredOptional added in v0.24.0

func NewMeteredOptional(memoryGauge common.MemoryGauge, value Value) Optional

func NewOptional

func NewOptional(value Value) Optional

func (Optional) MeteredType added in v0.24.0

func (o Optional) MeteredType(gauge common.MemoryGauge) Type

func (Optional) String added in v0.12.0

func (o Optional) String() string

func (Optional) ToGoValue

func (o Optional) ToGoValue() any

func (Optional) Type

func (o Optional) Type() Type

type OptionalType

type OptionalType struct {
	Type Type
	// contains filtered or unexported fields
}

func NewMeteredOptionalType added in v0.24.0

func NewMeteredOptionalType(gauge common.MemoryGauge, typ Type) *OptionalType

func NewOptionalType added in v0.24.0

func NewOptionalType(typ Type) *OptionalType

func (*OptionalType) Equal added in v0.31.1

func (t *OptionalType) Equal(other Type) bool

func (*OptionalType) ID

func (t *OptionalType) ID() string

type Parameter

type Parameter struct {
	Type       Type
	Label      string
	Identifier string
}

func NewParameter added in v0.24.0

func NewParameter(
	label string,
	identifier string,
	typ Type,
) Parameter

type Path added in v0.10.0

type Path struct {
	Domain     common.PathDomain
	Identifier string
}

func NewMeteredPath added in v0.24.0

func NewMeteredPath(gauge common.MemoryGauge, domain common.PathDomain, identifier string) (Path, error)

func NewPath added in v0.24.0

func NewPath(domain common.PathDomain, identifier string) (Path, error)

func (Path) MeteredType added in v0.24.0

func (v Path) MeteredType(common.MemoryGauge) Type

func (Path) String added in v0.12.0

func (v Path) String() string

func (Path) ToGoValue added in v0.10.0

func (Path) ToGoValue() any

func (Path) Type added in v0.10.0

func (v Path) Type() Type

type PathCapability added in v0.39.0

type PathCapability struct {
	BorrowType Type
	Path       Path
	Address    Address
}

func NewMeteredPathCapability added in v0.39.0

func NewMeteredPathCapability(
	gauge common.MemoryGauge,
	address Address,
	path Path,
	borrowType Type,
) PathCapability

func NewPathCapability added in v0.39.0

func NewPathCapability(
	address Address,
	path Path,
	borrowType Type,
) PathCapability

func (PathCapability) MeteredType added in v0.39.0

func (v PathCapability) MeteredType(gauge common.MemoryGauge) Type

func (PathCapability) String added in v0.39.0

func (v PathCapability) String() string

func (PathCapability) ToGoValue added in v0.39.0

func (PathCapability) ToGoValue() any

func (PathCapability) Type added in v0.39.0

func (v PathCapability) Type() Type
type PathLink struct {
	TargetPath Path
	// TODO: a future version might want to export the whole type
	BorrowType string
}
func NewMeteredPathLink(gauge common.MemoryGauge, targetPath Path, borrowType string) PathLink
func NewPathLink(targetPath Path, borrowType string) PathLink

func (PathLink) MeteredType added in v0.30.0

func (v PathLink) MeteredType(_ common.MemoryGauge) Type

func (PathLink) String added in v0.30.0

func (v PathLink) String() string

func (PathLink) ToGoValue added in v0.30.0

func (v PathLink) ToGoValue() any

func (PathLink) Type added in v0.30.0

func (v PathLink) Type() Type

type PathType added in v0.7.0

type PathType struct{}

func NewPathType added in v0.24.0

func NewPathType() PathType

func (PathType) Equal added in v0.31.1

func (t PathType) Equal(other Type) bool

func (PathType) ID added in v0.7.0

func (PathType) ID() string

type PrivatePathType added in v0.11.0

type PrivatePathType struct{}

func NewPrivatePathType added in v0.24.0

func NewPrivatePathType() PrivatePathType

func (PrivatePathType) Equal added in v0.31.1

func (t PrivatePathType) Equal(other Type) bool

func (PrivatePathType) ID added in v0.11.0

func (PrivatePathType) ID() string

type PublicAccountContractsType added in v0.24.0

type PublicAccountContractsType struct{}

PublicAccountContractsType

func NewPublicAccountContractsType added in v0.24.0

func NewPublicAccountContractsType() PublicAccountContractsType

func (PublicAccountContractsType) Equal added in v0.31.1

func (t PublicAccountContractsType) Equal(other Type) bool

func (PublicAccountContractsType) ID added in v0.24.0

type PublicAccountKeysType added in v0.24.0

type PublicAccountKeysType struct{}

PublicAccountKeysType

func NewPublicAccountKeysType added in v0.24.0

func NewPublicAccountKeysType() PublicAccountKeysType

func (PublicAccountKeysType) Equal added in v0.31.1

func (t PublicAccountKeysType) Equal(other Type) bool

func (PublicAccountKeysType) ID added in v0.24.0

type PublicAccountType added in v0.7.0

type PublicAccountType struct{}

PublicAccountType

func NewPublicAccountType added in v0.24.0

func NewPublicAccountType() PublicAccountType

func (PublicAccountType) Equal added in v0.31.1

func (t PublicAccountType) Equal(other Type) bool

func (PublicAccountType) ID added in v0.7.0

type PublicPathType added in v0.11.0

type PublicPathType struct{}

func NewPublicPathType added in v0.24.0

func NewPublicPathType() PublicPathType

func (PublicPathType) Equal added in v0.31.1

func (t PublicPathType) Equal(other Type) bool

func (PublicPathType) ID added in v0.11.0

func (PublicPathType) ID() string

type ReferenceType added in v0.7.0

type ReferenceType struct {
	Type          Type
	Authorization Authorization
	// contains filtered or unexported fields
}

func NewMeteredReferenceType added in v0.24.0

func NewMeteredReferenceType(
	gauge common.MemoryGauge,
	authorization Authorization,
	typ Type,
) *ReferenceType

func NewReferenceType added in v0.24.0

func NewReferenceType(
	authorization Authorization,
	typ Type,
) *ReferenceType

func (*ReferenceType) Equal added in v0.31.1

func (t *ReferenceType) Equal(other Type) bool

func (*ReferenceType) ID added in v0.7.0

func (t *ReferenceType) ID() string

type Resource

type Resource struct {
	ResourceType *ResourceType
	Fields       []Value
}

func NewMeteredResource added in v0.24.0

func NewMeteredResource(
	gauge common.MemoryGauge,
	numberOfFields int,
	constructor func() ([]Value, error),
) (Resource, error)

func NewResource

func NewResource(fields []Value) Resource

func (Resource) GetFieldValues added in v0.39.6

func (v Resource) GetFieldValues() []Value

func (Resource) GetFields added in v0.39.6

func (v Resource) GetFields() []Field

func (Resource) MeteredType added in v0.24.0

func (v Resource) MeteredType(common.MemoryGauge) Type

func (Resource) String added in v0.12.0

func (v Resource) String() string

func (Resource) ToGoValue

func (v Resource) ToGoValue() any

func (Resource) Type

func (v Resource) Type() Type

func (Resource) WithType

func (v Resource) WithType(typ *ResourceType) Resource

type ResourceInterfaceType added in v0.7.0

type ResourceInterfaceType struct {
	Location            common.Location
	QualifiedIdentifier string
	Fields              []Field
	Initializers        [][]Parameter
	// contains filtered or unexported fields
}

func NewMeteredResourceInterfaceType added in v0.24.0

func NewMeteredResourceInterfaceType(
	gauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *ResourceInterfaceType

func NewResourceInterfaceType added in v0.24.0

func NewResourceInterfaceType(
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *ResourceInterfaceType

func (*ResourceInterfaceType) Equal added in v0.31.1

func (t *ResourceInterfaceType) Equal(other Type) bool

func (*ResourceInterfaceType) ID added in v0.7.0

func (t *ResourceInterfaceType) ID() string

func (*ResourceInterfaceType) InterfaceFields added in v0.7.0

func (t *ResourceInterfaceType) InterfaceFields() []Field

func (*ResourceInterfaceType) InterfaceInitializers added in v0.7.0

func (t *ResourceInterfaceType) InterfaceInitializers() [][]Parameter

func (*ResourceInterfaceType) InterfaceTypeLocation added in v0.12.0

func (t *ResourceInterfaceType) InterfaceTypeLocation() common.Location

func (*ResourceInterfaceType) InterfaceTypeQualifiedIdentifier added in v0.12.0

func (t *ResourceInterfaceType) InterfaceTypeQualifiedIdentifier() string

func (*ResourceInterfaceType) SetInterfaceFields added in v0.24.3

func (t *ResourceInterfaceType) SetInterfaceFields(fields []Field)

type ResourceType

type ResourceType struct {
	Location            common.Location
	QualifiedIdentifier string
	Fields              []Field
	Initializers        [][]Parameter
	// contains filtered or unexported fields
}

func NewMeteredResourceType added in v0.24.0

func NewMeteredResourceType(
	gauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *ResourceType

func NewResourceType added in v0.24.0

func NewResourceType(
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *ResourceType

func (*ResourceType) CompositeFields

func (t *ResourceType) CompositeFields() []Field

func (*ResourceType) CompositeInitializers

func (t *ResourceType) CompositeInitializers() [][]Parameter

func (*ResourceType) CompositeTypeLocation added in v0.12.0

func (t *ResourceType) CompositeTypeLocation() common.Location

func (*ResourceType) CompositeTypeQualifiedIdentifier added in v0.12.0

func (t *ResourceType) CompositeTypeQualifiedIdentifier() string

func (*ResourceType) Equal added in v0.31.1

func (t *ResourceType) Equal(other Type) bool

func (*ResourceType) ID

func (t *ResourceType) ID() string

func (*ResourceType) SetCompositeFields added in v0.24.3

func (t *ResourceType) SetCompositeFields(fields []Field)

type RestrictedType added in v0.7.0

type RestrictedType struct {
	Type         Type
	Restrictions []Type
	// contains filtered or unexported fields
}

func NewMeteredRestrictedType added in v0.24.0

func NewMeteredRestrictedType(
	gauge common.MemoryGauge,
	typ Type,
	restrictions []Type,
) *RestrictedType

func NewRestrictedType added in v0.24.0

func NewRestrictedType(
	typ Type,
	restrictions []Type,
) *RestrictedType

func (*RestrictedType) Equal added in v0.31.1

func (t *RestrictedType) Equal(other Type) bool

func (*RestrictedType) ID added in v0.7.0

func (t *RestrictedType) ID() string

func (*RestrictedType) RestrictionSet added in v0.39.0

func (t *RestrictedType) RestrictionSet() RestrictionSet

type RestrictionSet added in v0.39.0

type RestrictionSet = map[Type]struct{}

type SignedFixedPointType added in v0.7.0

type SignedFixedPointType struct{}

func NewSignedFixedPointType added in v0.24.0

func NewSignedFixedPointType() SignedFixedPointType

func (SignedFixedPointType) Equal added in v0.31.1

func (t SignedFixedPointType) Equal(other Type) bool

func (SignedFixedPointType) ID added in v0.7.0

type SignedIntegerType added in v0.7.0

type SignedIntegerType struct{}

func NewSignedIntegerType added in v0.24.0

func NewSignedIntegerType() SignedIntegerType

func (SignedIntegerType) Equal added in v0.31.1

func (t SignedIntegerType) Equal(other Type) bool

func (SignedIntegerType) ID added in v0.7.0

type SignedNumberType added in v0.7.0

type SignedNumberType struct{}

func NewSignedNumberType added in v0.24.0

func NewSignedNumberType() SignedNumberType

func (SignedNumberType) Equal added in v0.31.1

func (t SignedNumberType) Equal(other Type) bool

func (SignedNumberType) ID added in v0.7.0

func (SignedNumberType) ID() string

type StoragePathType added in v0.11.0

type StoragePathType struct{}

func NewStoragePathType added in v0.24.0

func NewStoragePathType() StoragePathType

func (StoragePathType) Equal added in v0.31.1

func (t StoragePathType) Equal(other Type) bool

func (StoragePathType) ID added in v0.11.0

func (StoragePathType) ID() string

type String

type String string

func NewMeteredString added in v0.24.0

func NewMeteredString(
	memoryGauge common.MemoryGauge,
	memoryUsage common.MemoryUsage,
	stringConstructor func() string,
) (String, error)

func NewString

func NewString(s string) (String, error)

func (String) MeteredType added in v0.24.0

func (v String) MeteredType(common.MemoryGauge) Type

func (String) String added in v0.12.0

func (v String) String() string

func (String) ToGoValue

func (v String) ToGoValue() any

func (String) Type

func (String) Type() Type

type StringType

type StringType struct{}

func NewStringType added in v0.24.0

func NewStringType() StringType

func (StringType) Equal added in v0.31.1

func (t StringType) Equal(other Type) bool

func (StringType) ID

func (StringType) ID() string

type Struct

type Struct struct {
	StructType *StructType
	Fields     []Value
}

func NewMeteredStruct added in v0.24.0

func NewMeteredStruct(
	gauge common.MemoryGauge,
	numberOfFields int,
	constructor func() ([]Value, error),
) (Struct, error)

func NewStruct

func NewStruct(fields []Value) Struct

func (Struct) GetFieldValues added in v0.39.6

func (v Struct) GetFieldValues() []Value

func (Struct) GetFields added in v0.39.6

func (v Struct) GetFields() []Field

func (Struct) MeteredType added in v0.24.0

func (v Struct) MeteredType(common.MemoryGauge) Type

func (Struct) String added in v0.12.0

func (v Struct) String() string

func (Struct) ToGoValue

func (v Struct) ToGoValue() any

func (Struct) Type

func (v Struct) Type() Type

func (Struct) WithType

func (v Struct) WithType(typ *StructType) Struct

type StructInterfaceType added in v0.7.0

type StructInterfaceType struct {
	Location            common.Location
	QualifiedIdentifier string
	Fields              []Field
	Initializers        [][]Parameter
	// contains filtered or unexported fields
}

func NewMeteredStructInterfaceType added in v0.24.0

func NewMeteredStructInterfaceType(
	gauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *StructInterfaceType

func NewStructInterfaceType added in v0.24.0

func NewStructInterfaceType(
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *StructInterfaceType

func (*StructInterfaceType) Equal added in v0.31.1

func (t *StructInterfaceType) Equal(other Type) bool

func (*StructInterfaceType) ID added in v0.7.0

func (t *StructInterfaceType) ID() string

func (*StructInterfaceType) InterfaceFields added in v0.7.0

func (t *StructInterfaceType) InterfaceFields() []Field

func (*StructInterfaceType) InterfaceInitializers added in v0.7.0

func (t *StructInterfaceType) InterfaceInitializers() [][]Parameter

func (*StructInterfaceType) InterfaceTypeLocation added in v0.12.0

func (t *StructInterfaceType) InterfaceTypeLocation() common.Location

func (*StructInterfaceType) InterfaceTypeQualifiedIdentifier added in v0.12.0

func (t *StructInterfaceType) InterfaceTypeQualifiedIdentifier() string

func (*StructInterfaceType) SetInterfaceFields added in v0.24.3

func (t *StructInterfaceType) SetInterfaceFields(fields []Field)

type StructType

type StructType struct {
	Location            common.Location
	QualifiedIdentifier string
	Fields              []Field
	Initializers        [][]Parameter
	// contains filtered or unexported fields
}

func NewMeteredStructType added in v0.24.0

func NewMeteredStructType(
	gauge common.MemoryGauge,
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *StructType

func NewStructType added in v0.24.0

func NewStructType(
	location common.Location,
	qualifiedIdentifier string,
	fields []Field,
	initializers [][]Parameter,
) *StructType

func (*StructType) CompositeFields

func (t *StructType) CompositeFields() []Field

func (*StructType) CompositeInitializers

func (t *StructType) CompositeInitializers() [][]Parameter

func (*StructType) CompositeTypeLocation added in v0.12.0

func (t *StructType) CompositeTypeLocation() common.Location

func (*StructType) CompositeTypeQualifiedIdentifier added in v0.12.0

func (t *StructType) CompositeTypeQualifiedIdentifier() string

func (*StructType) Equal added in v0.31.1

func (t *StructType) Equal(other Type) bool

func (*StructType) ID

func (t *StructType) ID() string

func (*StructType) SetCompositeFields added in v0.24.3

func (t *StructType) SetCompositeFields(fields []Field)

type Type

type Type interface {
	ID() string
	Equal(other Type) bool
	// contains filtered or unexported methods
}

func TypeWithCachedTypeID added in v0.35.0

func TypeWithCachedTypeID(t Type) Type

TypeWithCachedTypeID recursively caches type ID of type t. This is needed because each type ID is lazily cached on its first use in ID() to avoid performance penalty.

type TypeID added in v0.24.4

type TypeID string

TypeID is a type which is only known by its type ID. This type should not be used when encoding values, and should only be used for decoding values that were encoded using an older format of the JSON encoding (<v0.3.0)

func (TypeID) Equal added in v0.31.1

func (t TypeID) Equal(other Type) bool

func (TypeID) ID added in v0.24.4

func (t TypeID) ID() string

type TypeParameter added in v0.39.0

type TypeParameter struct {
	Name      string
	TypeBound Type
}

func NewTypeParameter added in v0.39.0

func NewTypeParameter(
	name string,
	typeBound Type,
) TypeParameter

type TypeValue added in v0.10.0

type TypeValue struct {
	StaticType Type
}

func NewMeteredTypeValue added in v0.24.0

func NewMeteredTypeValue(gauge common.MemoryGauge, staticType Type) TypeValue

func NewTypeValue added in v0.24.0

func NewTypeValue(staticType Type) TypeValue

func (TypeValue) MeteredType added in v0.24.0

func (v TypeValue) MeteredType(common.MemoryGauge) Type

func (TypeValue) String added in v0.12.0

func (v TypeValue) String() string

func (TypeValue) ToGoValue added in v0.10.0

func (TypeValue) ToGoValue() any

func (TypeValue) Type added in v0.10.0

func (TypeValue) Type() Type

type UFix64

type UFix64 uint64

func NewMeteredUFix64 added in v0.24.0

func NewMeteredUFix64(gauge common.MemoryGauge, constructor func() (string, error)) (UFix64, error)

func NewMeteredUFix64FromRawFixedPointNumber added in v0.39.0

func NewMeteredUFix64FromRawFixedPointNumber(gauge common.MemoryGauge, n uint64) (UFix64, error)

func NewUFix64

func NewUFix64(s string) (UFix64, error)

func NewUFix64FromParts added in v0.5.0

func NewUFix64FromParts(integer int, fraction uint) (UFix64, error)

func (UFix64) MeteredType added in v0.24.0

func (v UFix64) MeteredType(common.MemoryGauge) Type

func (UFix64) String added in v0.12.0

func (v UFix64) String() string

func (UFix64) ToBigEndianBytes added in v0.5.0

func (v UFix64) ToBigEndianBytes() []byte

func (UFix64) ToGoValue

func (v UFix64) ToGoValue() any

func (UFix64) Type

func (UFix64) Type() Type

type UFix64Type

type UFix64Type struct{}

func NewUFix64Type added in v0.24.0

func NewUFix64Type() UFix64Type

func (UFix64Type) Equal added in v0.31.1

func (t UFix64Type) Equal(other Type) bool

func (UFix64Type) ID

func (UFix64Type) ID() string

type UInt

type UInt struct {
	Value *big.Int
}

func NewMeteredUIntFromBig added in v0.24.0

func NewMeteredUIntFromBig(
	memoryGauge common.MemoryGauge,
	memoryUsage common.MemoryUsage,
	bigIntConstructor func() *big.Int,
) (UInt, error)

func NewUInt

func NewUInt(i uint) UInt

func NewUIntFromBig

func NewUIntFromBig(i *big.Int) (UInt, error)

func (UInt) Big

func (v UInt) Big() *big.Int

func (UInt) Int

func (v UInt) Int() int

func (UInt) MeteredType added in v0.24.0

func (v UInt) MeteredType(common.MemoryGauge) Type

func (UInt) String added in v0.12.0

func (v UInt) String() string

func (UInt) ToBigEndianBytes added in v0.5.0

func (v UInt) ToBigEndianBytes() []byte

func (UInt) ToGoValue

func (v UInt) ToGoValue() any

func (UInt) Type

func (UInt) Type() Type

type UInt128

type UInt128 struct {
	Value *big.Int
}

func NewMeteredUInt128FromBig added in v0.24.0

func NewMeteredUInt128FromBig(
	memoryGauge common.MemoryGauge,
	bigIntConstructor func() *big.Int,
) (UInt128, error)

func NewUInt128

func NewUInt128(i uint) UInt128

func NewUInt128FromBig

func NewUInt128FromBig(i *big.Int) (UInt128, error)

func (UInt128) Big

func (v UInt128) Big() *big.Int

func (UInt128) Int

func (v UInt128) Int() int

func (UInt128) MeteredType added in v0.24.0

func (v UInt128) MeteredType(common.MemoryGauge) Type

func (UInt128) String added in v0.12.0

func (v UInt128) String() string

func (UInt128) ToBigEndianBytes added in v0.5.0

func (v UInt128) ToBigEndianBytes() []byte

func (UInt128) ToGoValue

func (v UInt128) ToGoValue() any

func (UInt128) Type

func (UInt128) Type() Type

type UInt128Type

type UInt128Type struct{}

func NewUInt128Type added in v0.24.0

func NewUInt128Type() UInt128Type

func (UInt128Type) Equal added in v0.31.1

func (t UInt128Type) Equal(other Type) bool

func (UInt128Type) ID

func (UInt128Type) ID() string

type UInt16

type UInt16 uint16

func NewMeteredUInt16 added in v0.24.0

func NewMeteredUInt16(gauge common.MemoryGauge, v uint16) UInt16

func NewUInt16

func NewUInt16(v uint16) UInt16

func (UInt16) MeteredType added in v0.24.0

func (v UInt16) MeteredType(common.MemoryGauge) Type

func (UInt16) String added in v0.12.0

func (v UInt16) String() string

func (UInt16) ToBigEndianBytes added in v0.5.0

func (v UInt16) ToBigEndianBytes() []byte

func (UInt16) ToGoValue

func (v UInt16) ToGoValue() any

func (UInt16) Type

func (UInt16) Type() Type

type UInt16Type

type UInt16Type struct{}

func NewUInt16Type added in v0.24.0

func NewUInt16Type() UInt16Type

func (UInt16Type) Equal added in v0.31.1

func (t UInt16Type) Equal(other Type) bool

func (UInt16Type) ID

func (UInt16Type) ID() string

type UInt256

type UInt256 struct {
	Value *big.Int
}

func NewMeteredUInt256FromBig added in v0.24.0

func NewMeteredUInt256FromBig(
	memoryGauge common.MemoryGauge,
	bigIntConstructor func() *big.Int,
) (UInt256, error)

func NewUInt256

func NewUInt256(i uint) UInt256

func NewUInt256FromBig

func NewUInt256FromBig(i *big.Int) (UInt256, error)

func (UInt256) Big

func (v UInt256) Big() *big.Int

func (UInt256) Int

func (v UInt256) Int() int

func (UInt256) MeteredType added in v0.24.0

func (v UInt256) MeteredType(common.MemoryGauge) Type

func (UInt256) String added in v0.12.0

func (v UInt256) String() string

func (UInt256) ToBigEndianBytes added in v0.5.0

func (v UInt256) ToBigEndianBytes() []byte

func (UInt256) ToGoValue

func (v UInt256) ToGoValue() any

func (UInt256) Type

func (UInt256) Type() Type

type UInt256Type

type UInt256Type struct{}

func NewUInt256Type added in v0.24.0

func NewUInt256Type() UInt256Type

func (UInt256Type) Equal added in v0.31.1

func (t UInt256Type) Equal(other Type) bool

func (UInt256Type) ID

func (UInt256Type) ID() string

type UInt32

type UInt32 uint32

func NewMeteredUInt32 added in v0.24.0

func NewMeteredUInt32(gauge common.MemoryGauge, v uint32) UInt32

func NewUInt32

func NewUInt32(v uint32) UInt32

func (UInt32) MeteredType added in v0.24.0

func (v UInt32) MeteredType(common.MemoryGauge) Type

func (UInt32) String added in v0.12.0

func (v UInt32) String() string

func (UInt32) ToBigEndianBytes added in v0.5.0

func (v UInt32) ToBigEndianBytes() []byte

func (UInt32) ToGoValue

func (v UInt32) ToGoValue() any

func (UInt32) Type

func (UInt32) Type() Type

type UInt32Type

type UInt32Type struct{}

func NewUInt32Type added in v0.24.0

func NewUInt32Type() UInt32Type

func (UInt32Type) Equal added in v0.31.1

func (t UInt32Type) Equal(other Type) bool

func (UInt32Type) ID

func (UInt32Type) ID() string

type UInt64

type UInt64 uint64

func NewMeteredUInt64 added in v0.24.0

func NewMeteredUInt64(gauge common.MemoryGauge, v uint64) UInt64

func NewUInt64

func NewUInt64(v uint64) UInt64

func (UInt64) MeteredType added in v0.24.0

func (v UInt64) MeteredType(common.MemoryGauge) Type

func (UInt64) String added in v0.12.0

func (v UInt64) String() string

func (UInt64) ToBigEndianBytes added in v0.5.0

func (v UInt64) ToBigEndianBytes() []byte

func (UInt64) ToGoValue

func (v UInt64) ToGoValue() any

func (UInt64) Type

func (UInt64) Type() Type

type UInt64Type

type UInt64Type struct{}

func NewUInt64Type added in v0.24.0

func NewUInt64Type() UInt64Type

func (UInt64Type) Equal added in v0.31.1

func (t UInt64Type) Equal(other Type) bool

func (UInt64Type) ID

func (UInt64Type) ID() string

type UInt8

type UInt8 uint8

func NewMeteredUInt8 added in v0.24.0

func NewMeteredUInt8(gauge common.MemoryGauge, v uint8) UInt8

func NewUInt8

func NewUInt8(v uint8) UInt8

func (UInt8) MeteredType added in v0.24.0

func (v UInt8) MeteredType(common.MemoryGauge) Type

func (UInt8) String added in v0.12.0

func (v UInt8) String() string

func (UInt8) ToBigEndianBytes added in v0.5.0

func (v UInt8) ToBigEndianBytes() []byte

func (UInt8) ToGoValue

func (v UInt8) ToGoValue() any

func (UInt8) Type

func (UInt8) Type() Type

type UInt8Type

type UInt8Type struct{}

func NewUInt8Type added in v0.24.0

func NewUInt8Type() UInt8Type

func (UInt8Type) Equal added in v0.31.1

func (t UInt8Type) Equal(other Type) bool

func (UInt8Type) ID

func (UInt8Type) ID() string

type UIntType

type UIntType struct{}

func NewUIntType added in v0.24.0

func NewUIntType() UIntType

func (UIntType) Equal added in v0.31.1

func (t UIntType) Equal(other Type) bool

func (UIntType) ID

func (UIntType) ID() string

type Unauthorized added in v1.0.0

type Unauthorized struct{}

func (Unauthorized) Equal added in v1.0.0

func (Unauthorized) Equal(auth Authorization) bool

func (Unauthorized) ID added in v1.0.0

func (Unauthorized) ID() string

type Value

type Value interface {
	Type() Type
	MeteredType(gauge common.MemoryGauge) Type
	ToGoValue() any
	fmt.Stringer
	// contains filtered or unexported methods
}

func GetFieldByName added in v0.39.6

func GetFieldByName(v HasFields, fieldName string) Value

func MustConvertValue

func MustConvertValue(value any) Value

MustConvertValue converts a Go value to an ABI value or panics if the value cannot be converted.

func NewValue

func NewValue(value any) (Value, error)

Unmetered because this function is only used by the client.

type VariableSizedArrayType

type VariableSizedArrayType struct {
	ElementType Type
	// contains filtered or unexported fields
}

func NewMeteredVariableSizedArrayType added in v0.24.0

func NewMeteredVariableSizedArrayType(
	gauge common.MemoryGauge,
	elementType Type,
) *VariableSizedArrayType

func NewVariableSizedArrayType added in v0.24.0

func NewVariableSizedArrayType(
	elementType Type,
) *VariableSizedArrayType

func (*VariableSizedArrayType) Element

func (t *VariableSizedArrayType) Element() Type

func (*VariableSizedArrayType) Equal added in v0.31.1

func (t *VariableSizedArrayType) Equal(other Type) bool

func (*VariableSizedArrayType) ID

type Void

type Void struct{}

func NewMeteredVoid added in v0.24.0

func NewMeteredVoid(memoryGauge common.MemoryGauge) Void

func NewVoid

func NewVoid() Void

func (Void) MeteredType added in v0.24.0

func (v Void) MeteredType(common.MemoryGauge) Type

func (Void) String added in v0.12.0

func (Void) String() string

func (Void) ToGoValue

func (Void) ToGoValue() any

func (Void) Type

func (Void) Type() Type

type VoidType

type VoidType struct{}

func NewVoidType added in v0.24.0

func NewVoidType() VoidType

func (VoidType) Equal added in v0.31.1

func (t VoidType) Equal(other Type) bool

func (VoidType) ID

func (VoidType) ID() string

type Word128 added in v0.39.0

type Word128 struct {
	Value *big.Int
}

func NewMeteredWord128FromBig added in v0.39.0

func NewMeteredWord128FromBig(
	memoryGauge common.MemoryGauge,
	bigIntConstructor func() *big.Int,
) (Word128, error)

func NewWord128 added in v0.39.0

func NewWord128(i uint) Word128

func NewWord128FromBig added in v0.39.0

func NewWord128FromBig(i *big.Int) (Word128, error)

func (Word128) Big added in v0.39.0

func (v Word128) Big() *big.Int

func (Word128) Int added in v0.39.0

func (v Word128) Int() int

func (Word128) MeteredType added in v0.39.0

func (v Word128) MeteredType(common.MemoryGauge) Type

func (Word128) String added in v0.39.0

func (v Word128) String() string

func (Word128) ToBigEndianBytes added in v0.39.0

func (v Word128) ToBigEndianBytes() []byte

func (Word128) ToGoValue added in v0.39.0

func (v Word128) ToGoValue() any

func (Word128) Type added in v0.39.0

func (Word128) Type() Type

type Word128Type added in v0.39.0

type Word128Type struct{}

func NewWord128Type added in v0.39.0

func NewWord128Type() Word128Type

func (Word128Type) Equal added in v0.39.0

func (t Word128Type) Equal(other Type) bool

func (Word128Type) ID added in v0.39.0

func (Word128Type) ID() string

type Word16

type Word16 uint16

func NewMeteredWord16 added in v0.24.0

func NewMeteredWord16(gauge common.MemoryGauge, v uint16) Word16

func NewWord16

func NewWord16(v uint16) Word16

func (Word16) MeteredType added in v0.24.0

func (v Word16) MeteredType(common.MemoryGauge) Type

func (Word16) String added in v0.12.0

func (v Word16) String() string

func (Word16) ToBigEndianBytes added in v0.5.0

func (v Word16) ToBigEndianBytes() []byte

func (Word16) ToGoValue

func (v Word16) ToGoValue() any

func (Word16) Type

func (Word16) Type() Type

type Word16Type

type Word16Type struct{}

func NewWord16Type added in v0.24.0

func NewWord16Type() Word16Type

func (Word16Type) Equal added in v0.31.1

func (t Word16Type) Equal(other Type) bool

func (Word16Type) ID

func (Word16Type) ID() string

type Word256 added in v0.39.0

type Word256 struct {
	Value *big.Int
}

func NewMeteredWord256FromBig added in v0.39.0

func NewMeteredWord256FromBig(
	memoryGauge common.MemoryGauge,
	bigIntConstructor func() *big.Int,
) (Word256, error)

func NewWord256 added in v0.39.0

func NewWord256(i uint) Word256

func NewWord256FromBig added in v0.39.0

func NewWord256FromBig(i *big.Int) (Word256, error)

func (Word256) Big added in v0.39.0

func (v Word256) Big() *big.Int

func (Word256) Int added in v0.39.0

func (v Word256) Int() int

func (Word256) MeteredType added in v0.39.0

func (v Word256) MeteredType(common.MemoryGauge) Type

func (Word256) String added in v0.39.0

func (v Word256) String() string

func (Word256) ToBigEndianBytes added in v0.39.0

func (v Word256) ToBigEndianBytes() []byte

func (Word256) ToGoValue added in v0.39.0

func (v Word256) ToGoValue() any

func (Word256) Type added in v0.39.0

func (Word256) Type() Type

type Word256Type added in v0.39.0

type Word256Type struct{}

func NewWord256Type added in v0.39.0

func NewWord256Type() Word256Type

func (Word256Type) Equal added in v0.39.0

func (t Word256Type) Equal(other Type) bool

func (Word256Type) ID added in v0.39.0

func (Word256Type) ID() string

type Word32

type Word32 uint32

func NewMeteredWord32 added in v0.24.0

func NewMeteredWord32(gauge common.MemoryGauge, v uint32) Word32

func NewWord32

func NewWord32(v uint32) Word32

func (Word32) MeteredType added in v0.24.0

func (v Word32) MeteredType(common.MemoryGauge) Type

func (Word32) String added in v0.12.0

func (v Word32) String() string

func (Word32) ToBigEndianBytes added in v0.5.0

func (v Word32) ToBigEndianBytes() []byte

func (Word32) ToGoValue

func (v Word32) ToGoValue() any

func (Word32) Type

func (Word32) Type() Type

type Word32Type

type Word32Type struct{}

func NewWord32Type added in v0.24.0

func NewWord32Type() Word32Type

func (Word32Type) Equal added in v0.31.1

func (t Word32Type) Equal(other Type) bool

func (Word32Type) ID

func (Word32Type) ID() string

type Word64

type Word64 uint64

func NewMeteredWord64 added in v0.24.0

func NewMeteredWord64(gauge common.MemoryGauge, v uint64) Word64

func NewWord64

func NewWord64(v uint64) Word64

func (Word64) MeteredType added in v0.24.0

func (v Word64) MeteredType(common.MemoryGauge) Type

func (Word64) String added in v0.12.0

func (v Word64) String() string

func (Word64) ToBigEndianBytes added in v0.5.0

func (v Word64) ToBigEndianBytes() []byte

func (Word64) ToGoValue

func (v Word64) ToGoValue() any

func (Word64) Type

func (Word64) Type() Type

type Word64Type

type Word64Type struct{}

func NewWord64Type added in v0.24.0

func NewWord64Type() Word64Type

func (Word64Type) Equal added in v0.31.1

func (t Word64Type) Equal(other Type) bool

func (Word64Type) ID

func (Word64Type) ID() string

type Word8

type Word8 uint8

func NewMeteredWord8 added in v0.24.0

func NewMeteredWord8(gauge common.MemoryGauge, v uint8) Word8

func NewWord8

func NewWord8(v uint8) Word8

func (Word8) MeteredType added in v0.24.0

func (v Word8) MeteredType(common.MemoryGauge) Type

func (Word8) String added in v0.12.0

func (v Word8) String() string

func (Word8) ToBigEndianBytes added in v0.5.0

func (v Word8) ToBigEndianBytes() []byte

func (Word8) ToGoValue

func (v Word8) ToGoValue() any

func (Word8) Type

func (Word8) Type() Type

type Word8Type

type Word8Type struct{}

func NewWord8Type added in v0.24.0

func NewWord8Type() Word8Type

func (Word8Type) Equal added in v0.31.1

func (t Word8Type) Equal(other Type) bool

func (Word8Type) ID

func (Word8Type) ID() string

Directories

Path Synopsis
encoding
ccf
Package ccf implements CCF specification
Package ccf implements CCF specification
json
Package json implements the JSON-Cadence specification: https://github.com/onflow/flow/blob/master/docs/json-cadence-spec.md
Package json implements the JSON-Cadence specification: https://github.com/onflow/flow/blob/master/docs/json-cadence-spec.md
Package fixedpoint provides constants, as well as formatting, conversion, and checking functionality for Cadence fixed-point number types
Package fixedpoint provides constants, as well as formatting, conversion, and checking functionality for Cadence fixed-point number types
ast
Package ast contains all AST nodes for Cadence.
Package ast contains all AST nodes for Cadence.
cmd
cmd/minifier
* Cadence - The resource-oriented smart contract programming language * * Copyright Dapper Labs, Inc.
* Cadence - The resource-oriented smart contract programming language * * Copyright Dapper Labs, Inc.
common
uses the provided function `f` to generate a slice with no duplicates.
uses the provided function `f` to generate a slice with no duplicates.
common/list
Package list implements a doubly linked list.
Package list implements a doubly linked list.
compiler/wasm
WebAssembly (https://webassembly.org/) is an open standard for portable executable programs.
WebAssembly (https://webassembly.org/) is an open standard for portable executable programs.
tools
batch-script Module
docgen Module
get-contracts Module
golangci-lint Module
maprange Module
maprangecheck Module
unkeyed Module
utils
version
Generates a Go file version.go with a constant variableName, which contains the current semantic version as a string literal.
Generates a Go file version.go with a constant variableName, which contains the current semantic version as a string literal.

Jump to

Keyboard shortcuts

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