Documentation ¶
Index ¶
- Constants
- type Address
- type Base64Data
- type Bytes
- type BytesData
- type CertifiedTransaction
- type ChangeEpoch
- type Coin
- type Coins
- type Digest
- type Event
- type GasCostSummary
- type HexData
- type InputObjectKind
- type ModulePublish
- type MoveCall
- type ObjectId
- type ObjectInfo
- type ObjectOwner
- type ObjectRead
- type ObjectReadDetail
- type ObjectRef
- type ObjectStatus
- type OwnedObjectRef
- type ParsedTransactionResponse
- type ResourceType
- type SenderSignedData
- type SignatureScheme
- type SignedTransaction
- type SingleTransactionKind
- type TransactionBytes
- type TransactionEffects
- type TransactionEnvelope
- type TransactionResponse
- type TransactionResponseV2
- type TransactionStatus
- type TransferObject
- type TransferSui
Constants ¶
View Source
const ( TransactionStatusSuccess = "success" TransactionStatusFailure = "failure" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address = HexData
func NewAddressFromHex ¶
*
- Creates Address from a hex string.
- @param addr Hex string can be with a prefix or without a prefix,
- e.g. '0x1aa' or '1aa'. Hex string will be left padded with 0s if too short.
func (Address) ShortString ¶
Returns the address with leading zeros trimmed, e.g. 0x2
type Base64Data ¶
type Base64Data struct {
// contains filtered or unexported fields
}
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 Bytes ¶
type Bytes []byte
func (Bytes) GetBase64Data ¶
func (b Bytes) GetBase64Data() Base64Data
func (Bytes) GetHexData ¶
type CertifiedTransaction ¶
type CertifiedTransaction = TransactionEnvelope
type ChangeEpoch ¶
type Coin ¶
type Coin struct { Balance uint64 `json:"balance"` Type string `json:"type"` Owner *ObjectOwner `json:"owner"` PreviousTransaction *Digest `json:"previousTransaction"` Reference *ObjectRef `json:"reference"` }
type Digest ¶
type Digest = Base64Data
type GasCostSummary ¶
type HexData ¶
type HexData struct {
// contains filtered or unexported fields
}
func NewHexData ¶
func (HexData) MarshalJSON ¶
func (*HexData) UnmarshalJSON ¶
type InputObjectKind ¶
type InputObjectKind map[string]interface{}
type ModulePublish ¶
type ModulePublish struct {
Modules [][]byte `json:"modules"`
}
type ObjectInfo ¶
type ObjectOwner ¶
type ObjectRead ¶
type ObjectRead struct { Details *ObjectReadDetail `json:"details"` Status ObjectStatus `json:"status"` }
type ObjectReadDetail ¶
type ObjectReadDetail struct { Data map[string]interface{} `json:"data"` Owner *ObjectOwner `json:"owner"` PreviousTransaction *Digest `json:"previousTransaction"` StorageRebate int `json:"storageRebate"` Reference *ObjectRef `json:"reference"` }
type ObjectStatus ¶
type ObjectStatus string
const ( ObjectStatusExists ObjectStatus = "Exists" ObjectStatusNotExists ObjectStatus = "NotExists" ObjectStatusDeleted ObjectStatus = "Deleted" )
type OwnedObjectRef ¶
type OwnedObjectRef struct { Owner *ObjectOwner `json:"owner"` Reference *ObjectRef `json:"reference"` }
type ParsedTransactionResponse ¶
type ParsedTransactionResponse interface{}
type ResourceType ¶
type ResourceType struct { Address *Address ModuleName string FuncName string SubType *ResourceType }
func NewResourceType ¶
func NewResourceType(str string) (*ResourceType, error)
func (*ResourceType) ShortString ¶
func (t *ResourceType) ShortString() string
func (*ResourceType) String ¶
func (t *ResourceType) String() string
type SenderSignedData ¶
type SenderSignedData struct { Transactions []SingleTransactionKind `json:"transactions,omitempty"` Sender *Address `json:"sender"` GasPayment *ObjectRef `json:"gasPayment"` GasBudget uint64 `json:"gasBudget"` }
type SignatureScheme ¶
type SignatureScheme string
const ( SignatureSchemeEd25519 SignatureScheme = "ED25519" SignatureSchemeSecp256k1 SignatureScheme = "Secp256k1" )
type SignedTransaction ¶
type SignedTransaction struct { // transaction data bytes TxBytes *Base64Data `json:"tx_bytes"` // Flag of the signature scheme that is used. SigScheme SignatureScheme `json:"sig_scheme"` // transaction signature Signature *Base64Data `json:"signature"` // signer's public key PublicKey *Base64Data `json:"pub_key"` Mode string `json:"mode"` }
type SingleTransactionKind ¶
type SingleTransactionKind struct { TransferObject *TransferObject `json:"TransferObject,omitempty"` Publish *ModulePublish `json:"Publish,omitempty"` Call *MoveCall `json:"Call,omitempty"` TransferSui *TransferSui `json:"TransferSui,omitempty"` ChangeEpoch *ChangeEpoch `json:"ChangeEpoch,omitempty"` }
type TransactionBytes ¶
type TransactionBytes struct { // the gas object to be used Gas ObjectRef `json:"gas"` // objects to be used in this transaction InputObjects []InputObjectKind `json:"inputObjects"` // transaction data bytes TxBytes Base64Data `json:"txBytes"` }
func (*TransactionBytes) SignWith ¶
func (txn *TransactionBytes) SignWith(privateKey ed25519.PrivateKey) *SignedTransaction
type TransactionEffects ¶
type TransactionEffects struct { Status TransactionStatus `json:"status"` TransactionDigest *Base64Data `json:"transactionDigest"` GasUsed *GasCostSummary `json:"gasUsed"` GasObject *OwnedObjectRef `json:"gasObject"` Events []Event `json:"events,omitempty"` Dependencies []Digest `json:"dependencies,omitempty"` // SharedObjects []ObjectRef `json:"sharedObjects"` Created []OwnedObjectRef `json:"created,omitempty"` Mutated []OwnedObjectRef `json:"mutated,omitempty"` Unwrapped []OwnedObjectRef `json:"unwrapped,omitempty"` Deleted []ObjectRef `json:"deleted,omitempty"` Wrapped []ObjectRef `json:"wrapped,omitempty"` }
func (*TransactionEffects) GasFee ¶
func (te *TransactionEffects) GasFee() uint64
type TransactionEnvelope ¶
type TransactionEnvelope struct { TransactionDigest *Digest `json:"transactionDigest"` Data *SenderSignedData `json:"data"` TxSignature *Base64Data `json:"txSignature"` AuthSignInfo interface{} `json:"authSignInfo"` }
type TransactionResponse ¶
type TransactionResponse struct { Certificate *CertifiedTransaction `json:"certificate"` Effects *TransactionEffects `json:"effects"` ParsedData ParsedTransactionResponse `json:"parsed_data,omitempty"` TimestampMs uint64 `json:"timestamp_ms,omitempty"` }
type TransactionResponseV2 ¶
type TransactionResponseV2 struct {
EffectsCert TransactionResponse `json:"effectsCert"`
}
type TransactionStatus ¶
type TransferObject ¶
type TransferSui ¶
Click to show internal directories.
Click to hide internal directories.