sui

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccountFromMnemonic

func NewAccountFromMnemonic(mnemonic, path string) (signing.AccountHandler, error)

func NewAccountFromPrivateKey

func NewAccountFromPrivateKey(privateKey []byte) (signing.AccountHandler, error)

func NewAccountFromPrivateKeyHex

func NewAccountFromPrivateKeyHex(privateKey string) (signing.AccountHandler, error)

func PublicKey2Address

func PublicKey2Address(publicKey []byte) (string, error)

func ValidAddress

func ValidAddress(address string) bool

Types

type Account

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

func (*Account) Address

func (a *Account) Address() string

func (*Account) PrivateKey

func (a *Account) PrivateKey() []byte

func (*Account) PrivateKeyHex

func (a *Account) PrivateKeyHex() string

func (*Account) PublicKey

func (a *Account) PublicKey() []byte

func (*Account) PublicKeyHex

func (a *Account) PublicKeyHex() string

func (*Account) SignData

func (a *Account) SignData(data []byte) ([]byte, error)

func (*Account) VerifySignData

func (a *Account) VerifySignData(data, sig []byte) bool

func (*Account) Wipe added in v0.9.0

func (a *Account) Wipe()

type CoinItem

type CoinItem struct {
	CoinType            string `json:"coinType"`
	CoinObjectId        string `json:"coinObjectId"`
	Version             string `json:"version"`
	Digest              string `json:"digest"`
	Balance             string `json:"balance"`
	PreviousTransaction string `json:"previousTransaction"`
}

type Coins

type Coins []CoinItem

type Ingredient

type Ingredient struct {
	TxType          string `json:"txType" validate:"required,oneof=0 1 2 3 4 5 6"`
	ContractAddress string `json:"contractAddress" validate:"required"`
	Sender          string `json:"sender" validate:"required,sui_addr"`
	Recipient       string `json:"recipient" validate:"required,sui_addr"`
	Amount          string `json:"amount" validate:"required,u64_gt0"`
	GasPrice        string `json:"gasPrice" validate:"required,u64_gt0"`
	GasBudget       string `json:"gasBudget" validate:"required,u64_gt0"`
	Coins           string `json:"coins" validate:"required"`
	GasCoins        string `json:"gasCoins"` // SUI coins for gas payment

}

types

type TxBuilder

type TxBuilder struct {
	*Ingredient
	// contains filtered or unexported fields
}

types

func NewTxBuilder

func NewTxBuilder(ti *Ingredient) *TxBuilder

func NewTxBuilderFromUnsignedHex

func NewTxBuilderFromUnsignedHex(unsignedHex string) (*TxBuilder, error)

func (*TxBuilder) Build

func (tx *TxBuilder) Build() error

func (*TxBuilder) ConcatSignature

func (tx *TxBuilder) ConcatSignature(signature string, isDerFormat bool) (string, error)

func (*TxBuilder) GetSigHash

func (tx *TxBuilder) GetSigHash() []string

func (*TxBuilder) GetTxHash

func (tx *TxBuilder) GetTxHash() string

func (*TxBuilder) GetUnsignedHex

func (tx *TxBuilder) GetUnsignedHex() string

func (*TxBuilder) SetSigHash

func (tx *TxBuilder) SetSigHash(sigHash []string)

func (*TxBuilder) SetUnsignedHex

func (tx *TxBuilder) SetUnsignedHex(unsignedHex string)

func (*TxBuilder) Sign

func (tx *TxBuilder) Sign(privateKey []byte) (string, error)

Jump to

Keyboard shortcuts

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