Documentation
¶
Index ¶
- func BuildAmount(amount uint64) *sui.Amount
- func BuildObjectRef(objectID string, version uint64, objectDigest string) *sui.ObjectRef
- func BuildPaySuiTransaction(inputCoins []*sui.ObjectRef, recipients []string, amounts []uint64) *sui.PaySui
- type PaySuiRequest
- func (req *PaySuiRequest) SetAmounts(amounts []uint64) *PaySuiRequest
- func (req *PaySuiRequest) SetGasBudget(gasBudget uint64) *PaySuiRequest
- func (req *PaySuiRequest) SetInputCoins(inputCoins []string) *PaySuiRequest
- func (req *PaySuiRequest) SetPrivateKey(privateKey []byte) *PaySuiRequest
- func (req *PaySuiRequest) SetRecipients(recipients []string) *PaySuiRequest
- func (req *PaySuiRequest) SetReferenceGasPrice(referenceGasPrice uint64) *PaySuiRequest
- func (req *PaySuiRequest) SetSigner(signer string) *PaySuiRequest
- func (req *PaySuiRequest) Validate() error
- type SuiChain
- func (c *SuiChain) BuildSigningInput(privateKey []byte, gasBudget uint64, referenceGasPrice uint64, signer string) *sui.SigningInput
- func (c *SuiChain) BuildSigningInputFromRequest(request *PaySuiRequest) (*sui.SigningInput, error)
- func (c *SuiChain) CompileTransaction(txInput *chain_abstraction.TransactionInput, signatures [][]byte, ...) ([]byte, error)
- func (c *SuiChain) CreateAndSignTransaction(input interface{}, privateKey []byte) ([]byte, error)
- func (c *SuiChain) GetPreimageHash(txInput *chain_abstraction.TransactionInput) ([]byte, []byte, error)
- func (c *SuiChain) GetTransactionHash(encodedTx []byte) (string, error)
- func (c *SuiChain) PrepareTransaction(input interface{}) (*chain_abstraction.TransactionInput, error)
- func (c *SuiChain) Sign(data []byte, privateKey []byte) ([]byte, error)
- func (c *SuiChain) ValidateTransactionInput(input interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildObjectRef ¶
BuildObjectRef creates an ObjectRef
Types ¶
type PaySuiRequest ¶
type PaySuiRequest struct {
// Input coins to spend (object IDs)
InputCoins []string `json:"input_coins"`
// Recipient addresses
Recipients []string `json:"recipients"`
// Amounts to send to each recipient (in MIST - 1 SUI = 1,000,000,000 MIST)
Amounts []uint64 `json:"amounts"`
// Gas budget for the transaction
GasBudget uint64 `json:"gas_budget"`
// Reference gas price
ReferenceGasPrice uint64 `json:"reference_gas_price"`
// Optional signer address (required for external signing)
Signer string `json:"signer,omitempty"`
// Optional private key (for direct signing)
PrivateKey []byte `json:"private_key,omitempty"`
}
PaySuiRequest represents a user-friendly request for PaySui transactions
func NewPaySuiRequest ¶
func NewPaySuiRequest() *PaySuiRequest
NewPaySuiRequest creates a new PaySuiRequest with default values
func NewPaySuiRequestWithDefaults ¶
func NewPaySuiRequestWithDefaults(gasBudget, gasPrice uint64) *PaySuiRequest
NewPaySuiRequestWithDefaults creates a new PaySuiRequest with configurable default gas values
func (*PaySuiRequest) SetAmounts ¶
func (req *PaySuiRequest) SetAmounts(amounts []uint64) *PaySuiRequest
SetAmounts sets the amounts
func (*PaySuiRequest) SetGasBudget ¶
func (req *PaySuiRequest) SetGasBudget(gasBudget uint64) *PaySuiRequest
SetGasBudget sets the gas budget
func (*PaySuiRequest) SetInputCoins ¶
func (req *PaySuiRequest) SetInputCoins(inputCoins []string) *PaySuiRequest
SetInputCoins sets the input coins
func (*PaySuiRequest) SetPrivateKey ¶
func (req *PaySuiRequest) SetPrivateKey(privateKey []byte) *PaySuiRequest
SetPrivateKey sets the private key
func (*PaySuiRequest) SetRecipients ¶
func (req *PaySuiRequest) SetRecipients(recipients []string) *PaySuiRequest
SetRecipients sets the recipients
func (*PaySuiRequest) SetReferenceGasPrice ¶
func (req *PaySuiRequest) SetReferenceGasPrice(referenceGasPrice uint64) *PaySuiRequest
SetReferenceGasPrice sets the reference gas price
func (*PaySuiRequest) SetSigner ¶
func (req *PaySuiRequest) SetSigner(signer string) *PaySuiRequest
SetSigner sets the signer address
func (*PaySuiRequest) Validate ¶
func (req *PaySuiRequest) Validate() error
Validate validates the PaySuiRequest
type SuiChain ¶
type SuiChain struct {
*chain_abstraction.BaseChain
}
SuiChain implements the Chain interface for SUI blockchain
func (*SuiChain) BuildSigningInput ¶
func (c *SuiChain) BuildSigningInput( privateKey []byte, gasBudget uint64, referenceGasPrice uint64, signer string, ) *sui.SigningInput
BuildSigningInput creates a Sui signing input for PaySui
func (*SuiChain) BuildSigningInputFromRequest ¶
func (c *SuiChain) BuildSigningInputFromRequest(request *PaySuiRequest) (*sui.SigningInput, error)
BuildSigningInputFromRequest builds a SigningInput from PaySuiRequest
func (*SuiChain) CompileTransaction ¶
func (c *SuiChain) CompileTransaction(txInput *chain_abstraction.TransactionInput, signatures [][]byte, publicKeys [][]byte) ([]byte, error)
CompileTransaction compiles a PaySui transaction with signatures
func (*SuiChain) CreateAndSignTransaction ¶
CreateAndSignTransaction creates and signs a PaySui transaction
func (*SuiChain) GetPreimageHash ¶
func (c *SuiChain) GetPreimageHash(txInput *chain_abstraction.TransactionInput) ([]byte, []byte, error)
GetPreimageHash gets the preimage hash for PaySui transaction
func (*SuiChain) GetTransactionHash ¶
GetTransactionHash gets the transaction hash
func (*SuiChain) PrepareTransaction ¶
func (c *SuiChain) PrepareTransaction(input interface{}) (*chain_abstraction.TransactionInput, error)
PrepareTransaction prepares a PaySui transaction for external signing
func (*SuiChain) ValidateTransactionInput ¶
ValidateTransactionInput validates only PaySui transaction input