Documentation
¶
Index ¶
- Constants
- Variables
- func IsSameAddressString(addr1, addr2 string) bool
- type Address
- type Base58
- type Base64Data
- type BigInt
- type Bytes
- type BytesData
- type CertificateDigest
- type CheckpointContentsDigest
- type CheckpointDigest
- type Data
- type Digest
- type EmptyEnum
- type EpochId
- type HexData
- type Identifier
- type MoveAbility
- type MoveAbilitySet
- type MoveFunctionArgType
- type MoveModule
- type MoveModuleId
- type MoveNormalizedField
- type MoveNormalizedFunction
- type MoveNormalizedModule
- type MoveNormalizedStruct
- type MoveNormalizedType
- type MoveNormalizedTypeStructType
- type MoveObject
- type MoveObjectType
- type MovePackage
- type MoveStructTypeParameter
- type MoveTypeParameterIndex
- type MoveVisibility
- type ObjectDigest
- type ObjectId
- type ObjectRef
- type ObjectType
- type Owner
- type PackageId
- type ProtocolVersion
- type ResourceType
- type SequenceNumber
- type StructTag
- type TransactionDigest
- type TransactionEffectsDigest
- type TransactionEventsDigest
- type TypeOrigin
- type TypeTag
- type UpgradeInfo
Constants ¶
View Source
const ( MoveVisibilityNone = iota MoveVisibilityPrivate MoveVisibilityPublic MoveVisibilityFriend )
View Source
const ( MoveAbilityNone = iota MoveAbilityCopy MoveAbilityDrop MoveAbilityStore MoveAbilityKey )
View Source
const ( UnitSui = 1e9 UnitMist = 1 )
View Source
const AddressLen = 32
Variables ¶
View Source
var ( SuiPackageIdMoveStdlib = MustPackageIdFromHex("0x1") SuiPackageIdSuiFramework = MustPackageIdFromHex("0x2") SuiPackageIdSuiSystem = MustPackageIdFromHex("0x3") SuiPackageIdBridge = MustPackageIdFromHex("0xb") SuiPackageIdDeepbook = MustPackageIdFromHex("0xdee9") )
View Source
var ( SuiObjectIdSystemState = MustObjectIdFromHex("0x5") SuiObjectIdClock = MustObjectIdFromHex("0x6") SuiObjectIdAuthenticatorState = MustObjectIdFromHex("0x7") SuiObjectIdRandomnessState = MustObjectIdFromHex("0x8") SuiObjectIdBridge = MustObjectIdFromHex("0x9") SuiObjectIdDenyList = MustObjectIdFromHex("0x403") )
View Source
var ()
View Source
var (
SuiCoinType = "0x2::sui::SUI"
)
Functions ¶
func IsSameAddressString ¶
Types ¶
type Address ¶
type Address [AddressLen]uint8
func AddressFromHex ¶
func MustAddressFromHex ¶
func (Address) MarshalBCS ¶
func (Address) MarshalJSON ¶
func (Address) ShortString ¶
ShortString Returns the address with leading zeros trimmed, e.g. 0x2
func (*Address) UnmarshalJSON ¶
type Base64Data ¶
type Base64Data []byte
func MustNewBase64Data ¶
func MustNewBase64Data(str string) *Base64Data
func NewBase64Data ¶
func NewBase64Data(str string) (*Base64Data, error)
func (Base64Data) Data ¶
func (h Base64Data) Data() []byte
func (Base64Data) Length ¶
func (h Base64Data) Length() int
func (Base64Data) MarshalJSON ¶
func (h Base64Data) MarshalJSON() ([]byte, error)
func (Base64Data) String ¶
func (h Base64Data) String() string
func (*Base64Data) UnmarshalJSON ¶
func (h *Base64Data) UnmarshalJSON(data []byte) error
type BigInt ¶
func NewBigIntInt64 ¶
func (*BigInt) MarshalJSON ¶
func (*BigInt) UnmarshalJSON ¶
func (*BigInt) UnmarshalText ¶
type Bytes ¶
type Bytes []byte
func (Bytes) GetBase64Data ¶
func (b Bytes) GetBase64Data() Base64Data
func (Bytes) GetHexData ¶
type CertificateDigest ¶
type CertificateDigest = Digest
type CheckpointContentsDigest ¶
type CheckpointContentsDigest = Digest
type CheckpointDigest ¶
type CheckpointDigest = Digest
type Data ¶
type Data struct { Move *MoveObject Package *MovePackage }
type HexData ¶
type HexData []byte
func NewHexData ¶
func (HexData) MarshalJSON ¶
func (HexData) ShortString ¶
func (*HexData) UnmarshalJSON ¶
type MoveAbility ¶
type MoveAbility int
func (*MoveAbility) UnmarshalJSON ¶
func (a *MoveAbility) UnmarshalJSON(data []byte) error
type MoveAbilitySet ¶
type MoveAbilitySet struct {
Abilities []MoveAbility
}
type MoveFunctionArgType ¶
type MoveFunctionArgType int
const ( MoveFunctionArgTypeNone MoveFunctionArgType = iota MoveFunctionArgTypePure MoveFunctionArgTypeImmutableReference MoveFunctionArgTypeMutableReference MoveFunctionArgTypeValue )
func (*MoveFunctionArgType) UnmarshalJSON ¶
func (m *MoveFunctionArgType) UnmarshalJSON(data []byte) error
type MoveModule ¶
type MoveModule struct { Package *ObjectId `json:"package"` Module Identifier `json:"module"` }
type MoveModuleId ¶
type MoveModuleId struct { Address *Address Name Identifier }
type MoveNormalizedField ¶
type MoveNormalizedField struct { Name Identifier Type *MoveNormalizedType }
type MoveNormalizedFunction ¶
type MoveNormalizedFunction struct { Visibility MoveVisibility IsEntry bool TypeParameters []MoveAbilitySet Parameters []MoveNormalizedType Return []MoveNormalizedType }
type MoveNormalizedModule ¶
type MoveNormalizedModule struct { FileFormatVersion uint32 Address *Address Name Identifier Friends []*MoveModuleId Structs map[Identifier]*MoveNormalizedStruct ExposedFunctions map[Identifier]*MoveNormalizedFunction }
type MoveNormalizedStruct ¶
type MoveNormalizedStruct struct { Abilities MoveAbilitySet TypeParameters []*MoveStructTypeParameter Fields []*MoveNormalizedField }
type MoveNormalizedType ¶
type MoveNormalizedType struct { Bool *EmptyEnum U8 *EmptyEnum U16 *EmptyEnum U32 *EmptyEnum U64 *EmptyEnum U128 *EmptyEnum U256 *EmptyEnum Address *EmptyEnum Signer *EmptyEnum Struct *MoveNormalizedTypeStructType Vector *MoveNormalizedType TypeParameter *MoveTypeParameterIndex Reference *MoveNormalizedType MutableReference *MoveNormalizedType }
func (*MoveNormalizedType) UnmarshalJSON ¶
func (s *MoveNormalizedType) UnmarshalJSON(data []byte) error
type MoveNormalizedTypeStructType ¶
type MoveNormalizedTypeStructType struct { Address *Address `json:"address"` Module Identifier `json:"module"` Name Identifier `json:"name"` TypeArguments []MoveNormalizedType `json:"typeArguments"` }
type MoveObject ¶
type MoveObject struct { Type MoveObjectType HasPublicTransfer bool Version SequenceNumber Contents []uint8 }
type MoveObjectType ¶
type MoveObjectType struct { Other *StructTag GasCoin *EmptyEnum StakedSui *EmptyEnum Coin *TypeTag }
func (MoveObjectType) IsBcsEnum ¶
func (o MoveObjectType) IsBcsEnum()
type MovePackage ¶
type MovePackage struct { Id ObjectId Version SequenceNumber ModuleMap map[string][]uint8 TypeOriginTable []TypeOrigin LinkageTable map[ObjectId]UpgradeInfo }
type MoveStructTypeParameter ¶
type MoveStructTypeParameter struct { Constraints MoveAbilitySet IsPhantom bool }
type MoveTypeParameterIndex ¶
type MoveTypeParameterIndex uint16
func NewMoveTypeParameterIndex ¶
func NewMoveTypeParameterIndex(i MoveTypeParameterIndex) *MoveTypeParameterIndex
type MoveVisibility ¶
type MoveVisibility int
func (*MoveVisibility) UnmarshalJSON ¶
func (v *MoveVisibility) UnmarshalJSON(data []byte) error
type ObjectDigest ¶
type ObjectDigest = Digest
type ObjectRef ¶
type ObjectRef struct { ObjectId *ObjectId `json:"objectId"` Version SequenceNumber `json:"version"` Digest *ObjectDigest `json:"digest"` }
ObjectRef for BCS, need to keep this order
type ObjectType ¶
type ObjectType = string
func ObjectTypeFromString ¶
func ObjectTypeFromString(str string) ObjectType
type Owner ¶
type Owner struct { AddressOwner *Address `json:"AddressOwner"` ObjectOwner *Address `json:"ObjectOwner"` InitialSharedVersion SequenceNumber `json:"initial_shared_version"` } `json:"Shared,omitempty"` Immutable *EmptyEnum `json:"Immutable,omitempty"` }
type ProtocolVersion ¶
type ProtocolVersion = uint64
type ResourceType ¶
type ResourceType struct { Address *Address Module Identifier ObjectName Identifier // it can be function name or struct name, etc. SubType *ResourceType }
func NewResourceType ¶
func NewResourceType(str string) (*ResourceType, error)
func (ResourceType) Contains ¶
func (r ResourceType) Contains(address *Address, moduleName string, funcName string) bool
func (*ResourceType) ShortString ¶
func (t *ResourceType) ShortString() string
func (*ResourceType) String ¶
func (t *ResourceType) String() string
type SequenceNumber ¶
type SequenceNumber = uint64
type StructTag ¶
type StructTag struct { Address *Address Module Identifier Name Identifier TypeParams []TypeTag }
func StructTagFromString ¶
func (*StructTag) MarshalJSON ¶
func (*StructTag) UnmarshalJSON ¶
type TransactionDigest ¶
type TransactionDigest = Digest
type TransactionEffectsDigest ¶
type TransactionEffectsDigest = Digest
type TransactionEventsDigest ¶
type TransactionEventsDigest = Digest
type TypeOrigin ¶
type TypeTag ¶
type TypeTag struct { Bool *EmptyEnum U8 *EmptyEnum U64 *EmptyEnum U128 *EmptyEnum Address *EmptyEnum Signer *EmptyEnum Vector *TypeTag Struct *StructTag U16 *EmptyEnum U32 *EmptyEnum U256 *EmptyEnum }
refer BCS doc https://github.com/diem/bcs/blob/master/README.md#externally-tagged-enumerations IMPORTANT! The order of the fields MATTERS! DON'T CHANGE! this is enum `TypeTag` in `external-crates/move/crates/move-core-types/src/language_storage.rs` each field should be the same as enum `TypeTag` there
func MustNewTypeTag ¶
func NewTypeTag ¶
refer TypeTagSerializer.parseFromStr() at 'sdk/typescript/src/bcs/type-tag-serializer.ts'
type UpgradeInfo ¶
type UpgradeInfo struct { UpgradedId ObjectId UpgradedVersion SequenceNumber }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.