Documentation
¶
Index ¶
- Constants
- Variables
- func AddressOrObjectOwner(obj *types.ObjectOwner) (string, bool)
- func ArgumentInput(index uint16) *bcs.Argument__Input
- func ArgumentResult(index uint16) *bcs.Argument__Result
- func Base58ToObjectDigest(str string) (bcs.ObjectDigest, error)
- func CheckError(err error) errors.Status
- func CoinEqual(coin1 *types.Coin, coin2 *types.Coin) bool
- func CoinToObject(coin *types.Coin) (*bcs.ObjectArg__ImmOrOwnedObject, error)
- func DecodeHex(str string) ([]byte, error)
- func HexToAddress(str string) (bcs.SuiAddress, error)
- func HexToObjectID(str string) (bcs.ObjectID, error)
- func HexToPure(str string) (*bcs.CallArg__Pure, error)
- func NewAddressBuilder(asset xc.ITask) (xc.AddressBuilder, error)
- func NormalizeCoinContract(contract string) string
- func SortCoins(coins []*types.Coin)
- func U64ToPure(x uint64) *bcs.CallArg__Pure
- type AddressBuilder
- type Checkpoint
- type Checkpoints
- type Client
- func (c *Client) EstimateGas(ctx context.Context) (xc.AmountBlockchain, error)
- func (c *Client) FetchBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
- func (c *Client) FetchBalanceFor(ctx context.Context, address xc.Address, contract string) (xc.AmountBlockchain, error)
- func (c *Client) FetchCheckpoint(ctx context.Context, checkpoint uint64) (*Checkpoint, error)
- func (client *Client) FetchDecimals(ctx context.Context, contract xc.ContractAddress) (int, error)
- func (c *Client) FetchLatestCheckpoint(ctx context.Context) (*Checkpoint, error)
- func (c *Client) FetchLegacyTxInfo(ctx context.Context, txHash xc.TxHash) (xc.LegacyTxInfo, error)
- func (c *Client) FetchLegacyTxInput(ctx context.Context, from xc.Address, to xc.Address) (xc.TxInput, error)
- func (c *Client) FetchNativeBalance(ctx context.Context, address xc.Address) (xc.AmountBlockchain, error)
- func (c *Client) FetchTransferInput(ctx context.Context, args xcbuilder.TransferArgs) (xc.TxInput, error)
- func (client *Client) FetchTxInfo(ctx context.Context, txHashStr xc.TxHash) (xclient.TxInfo, error)
- func (c *Client) GetAllCoinsFor(ctx context.Context, address xc.Address, contract string) ([]*types.Coin, error)
- func (c *Client) SubmitTx(ctx context.Context, tx xc.Tx) error
- type ObjectRef
- type SuiMethod
- type Tx
- type TxBuilder
- func (txBuilder TxBuilder) NewNativeTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)
- func (txBuilder TxBuilder) NewTokenTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)
- func (txBuilder TxBuilder) NewTransfer(from xc.Address, to xc.Address, amount xc.AmountBlockchain, input xc.TxInput) (xc.Tx, error)
- func (txBuilder TxBuilder) Transfer(args xcbuilder.TransferArgs, input xc.TxInput) (xc.Tx, error)
- type TxInput
- func (input *TxInput) ExcludeGasCoin()
- func (input *TxInput) GetDriver() xc.Driver
- func (input *TxInput) IndependentOf(other xc.TxInput) (independent bool)
- func (input *TxInput) IsNativeTransfer() bool
- func (input *TxInput) SafeFromDoubleSend(others ...xc.TxInput) (safe bool)
- func (input *TxInput) SetGasFeePriority(other xc.GasFeePriority) error
- func (input *TxInput) SetPublicKey(pubkey []byte) error
- func (input *TxInput) SetPublicKeyFromStr(pubkeyStr string) error
- func (input *TxInput) SortCoins()
- func (input *TxInput) TotalBalance() xc.AmountBlockchain
Constants ¶
View Source
const ( ADDRESS_LENGTH = 64 SIGNATURE_SCHEME_ED25519 = 0 SIGNATURE_SCHEME_SECP256k1 = 1 )
View Source
const GAS_BUDGET_PER_COIN = uint64(20_000_000)
Variables ¶
View Source
var (
MaxCoinObjects int = 50
)
Functions ¶
func AddressOrObjectOwner ¶
func AddressOrObjectOwner(obj *types.ObjectOwner) (string, bool)
func ArgumentInput ¶
func ArgumentInput(index uint16) *bcs.Argument__Input
func ArgumentResult ¶
func ArgumentResult(index uint16) *bcs.Argument__Result
func Base58ToObjectDigest ¶
func Base58ToObjectDigest(str string) (bcs.ObjectDigest, error)
func CheckError ¶
func CoinToObject ¶
func CoinToObject(coin *types.Coin) (*bcs.ObjectArg__ImmOrOwnedObject, error)
func HexToAddress ¶
func HexToAddress(str string) (bcs.SuiAddress, error)
func NewAddressBuilder ¶
func NewAddressBuilder(asset xc.ITask) (xc.AddressBuilder, error)
NewAddressBuilder creates a new Template AddressBuilder
func NormalizeCoinContract ¶
Strip the coin::Coin<_> wrapper if present
func U64ToPure ¶
func U64ToPure(x uint64) *bcs.CallArg__Pure
Types ¶
type AddressBuilder ¶
type AddressBuilder struct { }
func (AddressBuilder) GetAddressFromPublicKey ¶
func (ab AddressBuilder) GetAddressFromPublicKey(publicKeyBytes []byte) (xc.Address, error)
func (AddressBuilder) GetAllPossibleAddressesFromPublicKey ¶
func (ab AddressBuilder) GetAllPossibleAddressesFromPublicKey(publicKeyBytes []byte) ([]xc.PossibleAddress, error)
type Checkpoint ¶
type Checkpoint struct { Epoch string `json:"epoch"` SequenceNumber string `json:"sequenceNumber"` Digest string `json:"digest"` NetworkTotalTransactions string `json:"networkTotalTransactions"` PreviousDigest string `json:"PreviousDigest"` TimestampMs string `json:"timestampMs"` }
func (*Checkpoint) GetEpoch ¶
func (ch *Checkpoint) GetEpoch() uint64
func (*Checkpoint) GetSequenceNumber ¶
func (ch *Checkpoint) GetSequenceNumber() uint64
type Checkpoints ¶
type Checkpoints struct {
Data []*Checkpoint `json:"data"`
}
type Client ¶
Client for Sui
func (*Client) EstimateGas ¶
func (*Client) FetchBalance ¶
func (*Client) FetchBalanceFor ¶
func (*Client) FetchCheckpoint ¶
func (*Client) FetchDecimals ¶
func (*Client) FetchLatestCheckpoint ¶
func (c *Client) FetchLatestCheckpoint(ctx context.Context) (*Checkpoint, error)
func (*Client) FetchLegacyTxInfo ¶
func (*Client) FetchLegacyTxInput ¶
func (*Client) FetchNativeBalance ¶
func (*Client) FetchTransferInput ¶
func (*Client) FetchTxInfo ¶
func (*Client) GetAllCoinsFor ¶
type ObjectRef ¶
type ObjectRef struct { Field0 bcs.ObjectID Field1 bcs.SequenceNumber Field2 bcs.ObjectDigest }
type Tx ¶
type Tx struct { Tx bcs.TransactionData__V1 // contains filtered or unexported fields }
func (*Tx) AddSignatures ¶
func (tx *Tx) AddSignatures(signatures ...xc.TxSignature) error
func (Tx) GetSignatures ¶
func (tx Tx) GetSignatures() []xc.TxSignature
type TxBuilder ¶
func NewTxBuilder ¶
NewTxBuilder creates a new Template TxBuilder
func (TxBuilder) NewNativeTransfer ¶
func (TxBuilder) NewTokenTransfer ¶
type TxInput ¶
type TxInput struct { xc.TxInputEnvelope GasBudget uint64 `json:"gas_budget,omitempty"` GasPrice uint64 `json:"gas_price,omitempty"` Pubkey []byte `json:"pubkey,omitempty"` // Native Sui object that we can use to pay gas with GasCoin types.Coin `json:"gas_coin,omitempty"` // All objects (native or token) Coins []*types.Coin `json:"coins,omitempty"` // current epoch CurrentEpoch uint64 `json:"current_epoch,omitempty"` }
Tx for Template
func NewTxInput ¶
func NewTxInput() *TxInput
func (*TxInput) ExcludeGasCoin ¶
func (input *TxInput) ExcludeGasCoin()
func (*TxInput) IndependentOf ¶
func (*TxInput) IsNativeTransfer ¶
func (*TxInput) SafeFromDoubleSend ¶
func (*TxInput) SetGasFeePriority ¶
func (input *TxInput) SetGasFeePriority(other xc.GasFeePriority) error
func (*TxInput) SetPublicKey ¶
func (*TxInput) SetPublicKeyFromStr ¶
func (*TxInput) SortCoins ¶
func (input *TxInput) SortCoins()
Sort coins in place from highest to lowest
func (*TxInput) TotalBalance ¶
func (input *TxInput) TotalBalance() xc.AmountBlockchain
Click to show internal directories.
Click to hide internal directories.