Documentation
¶
Index ¶
- Constants
- func B64PublicKeyToSuiAddress(b64 string) (string, error)
- func B64ToSuiPrivateKey(b64 string) (string, error)
- func Ed25519PublicKeyToB64PublicKey(ed25519PubKey ed25519.PublicKey) string
- func NewSuiMessageWithIntent(message []byte, scope IntentScope) []byte
- func NewSuiProvider(rpc string) (*sdk_client.Client, error)
- func NewSuiProviderFromNetwork(network SuiNetwork) (*sdk_client.Client, error)
- func ParseFunctionTypeArguments(typeArgs []string) (typeArguments []move_types.TypeTag, err error)
- func ParseSignatureScheme(scheme byte) string
- func SuiPrivateKeyToB64(pk string) (string, error)
- func ToSerializedSignature(signature, pubKey []byte) string
- func VerifyMessage(message, signature string, scope IntentScope) (signer string, pass bool, err error)
- func VerifyPersonalMessage(message string, signature string) (signer string, pass bool, err error)
- func VerifyTransactionMessage(b64Message string, signature string) (signer string, pass bool, err error)
- type CompressedSignature
- type IntentScope
- type MultiSigPublicKeyStruct
- type MultiSigStruct
- type ProgrammableTransactionBlock
- func (ptb *ProgrammableTransactionBlock) Builder() *sui_types.ProgrammableTransactionBuilder
- func (ptb *ProgrammableTransactionBlock) Client() *SuiClient
- func (ptb *ProgrammableTransactionBlock) Context() context.Context
- func (ptb *ProgrammableTransactionBlock) Finish(sender string, gasObject *string, gasBudget, gasPrice uint64) ([]byte, error)
- func (ptb *ProgrammableTransactionBlock) FinishFromMultisig() ([]byte, error)
- func (ptb *ProgrammableTransactionBlock) FinishFromSigner() ([]byte, error)
- func (ptb *ProgrammableTransactionBlock) NewMoveCall(target string, args []interface{}, typeArgs []string) (*sui_types.Argument, error)
- func (ptb *ProgrammableTransactionBlock) ParseFunctionArguments(target string, args []interface{}) (arguments []sui_types.Argument, err error)
- type PubkeyEnumWeightPair
- type SignaturePubkeyPair
- type SuiClient
- func (cli *SuiClient) AutoUpdateGas(owner string, gas *SuiGasObject)
- func (client *SuiClient) Context() context.Context
- func (client *SuiClient) DevInspect(target string, args []interface{}, typeArgs []string) (*types.DevInspectResults, error)
- func (client *SuiClient) EnableAutoUpdateGasObjectFromMultiSig()
- func (client *SuiClient) EnableAutoUpdateGasObjectFromSigner()
- func (client *SuiClient) ExecuteTransaction(b64TxBytes string, signatures []any) (*types.SuiTransactionBlockResponse, error)
- func (client *SuiClient) GetAllCoins(owner string, coinType string) (data []types.Coin, err error)
- func (client *SuiClient) GetCoins(owner, coinType string, nextCursor *move_types.AccountAddress) (ret *types.Page[types.Coin, move_types.AccountAddress], err error)
- func (client *SuiClient) GetFunctionArgumentTypes(target string) ([]interface{}, error)
- func (cli *SuiClient) GetMaxCoinObject(address, coinType string) (*types.Coin, error)
- func (client *SuiClient) GetObject(objectId string) (*types.SuiObjectResponse, error)
- func (client *SuiClient) GetObjects(objectIds []string) ([]types.SuiObjectResponse, error)
- func (client *SuiClient) ImplementationOfDevInspect(txBytes string) (*types.DevInspectResults, error)
- func (client *SuiClient) MoveCallFromSigner(target string, args []interface{}, typeArgs []string) (result *types.SuiTransactionBlockResponse, err error)
- func (client *SuiClient) NewMoveCall(signer, gas, target string, args []interface{}, typeArgs []string) (*types.TransactionBytes, error)
- func (client *SuiClient) NewMoveCallFromMultiSig(target string, args []interface{}, typeArgs []string) (*types.TransactionBytes, error)
- func (client *SuiClient) NewMoveCallFromSigner(target string, args []interface{}, typeArgs []string) (*types.TransactionBytes, error)
- func (client *SuiClient) NewMultiSig(multisig *SuiMultiSig)
- func (client *SuiClient) NewProgrammableTransactionBlock(ctx context.Context) *ProgrammableTransactionBlock
- func (client *SuiClient) NewSigner(signer *SuiSigner)
- func (client *SuiClient) SetDefaultGasBudget(budget *big.Int)
- func (client *SuiClient) SetDefaultGasObjectToMultiSig(obj string)
- func (client *SuiClient) SetDefaultGasObjectToSigner(obj string)
- type SuiGasObject
- type SuiMultiSig
- type SuiMultiSigInfo
- type SuiMultiSigInfoSigner
- type SuiNetwork
- type SuiPubkeyWeightPair
- type SuiSignedDataRet
- type SuiSignedMessageRet
- type SuiSignedTransactionRet
- type SuiSigner
- func (s *SuiSigner) GetAddress() string
- func (s *SuiSigner) GetPulbicKey() string
- func (s *SuiSigner) SignMessage(data string, scope IntentScope) (*SuiSignedDataRet, error)
- func (s *SuiSigner) SignMessageBytes(data []byte) (*SuiSignedDataRet, error)
- func (s *SuiSigner) SignPersonalMessage(message string) (*SuiSignedMessageRet, error)
- func (s *SuiSigner) SignTransaction(b64TxBytes string) (*SuiSignedTransactionRet, error)
Constants ¶
View Source
const (
MaxSignerInMultisig = 10
)
View Source
const (
SuiGasCoinType = "0x2::sui::SUI"
)
Variables ¶
This section is empty.
Functions ¶
func NewSuiMessageWithIntent ¶
func NewSuiMessageWithIntent(message []byte, scope IntentScope) []byte
func NewSuiProvider ¶
func NewSuiProvider(rpc string) (*sdk_client.Client, error)
func NewSuiProviderFromNetwork ¶
func NewSuiProviderFromNetwork(network SuiNetwork) (*sdk_client.Client, error)
Create New Provider
func ParseFunctionTypeArguments ¶
func ParseFunctionTypeArguments(typeArgs []string) (typeArguments []move_types.TypeTag, err error)
func ParseSignatureScheme ¶
func SuiPrivateKeyToB64 ¶
func ToSerializedSignature ¶
func VerifyMessage ¶
func VerifyMessage(message, signature string, scope IntentScope) (signer string, pass bool, err error)
func VerifyPersonalMessage ¶
Types ¶
type CompressedSignature ¶
type CompressedSignature struct {
Signature [65]byte `json:"signature"`
}
type IntentScope ¶
type IntentScope = uint8
const ( TransactionDataIntentScope IntentScope = 0 PersonalMessageIntentScope IntentScope = 3 )
type MultiSigPublicKeyStruct ¶
type MultiSigPublicKeyStruct struct { PKMap []PubkeyEnumWeightPair `json:"pk_map"` Threshold uint16 `json:"threshold"` }
type MultiSigStruct ¶
type MultiSigStruct struct { Sigs []CompressedSignature `json:"sigs"` Bitmap uint16 `json:"bitmap"` MultisigPK MultiSigPublicKeyStruct `json:"multisig_pk"` }
type ProgrammableTransactionBlock ¶
type ProgrammableTransactionBlock struct {
// contains filtered or unexported fields
}
func (*ProgrammableTransactionBlock) Builder ¶
func (ptb *ProgrammableTransactionBlock) Builder() *sui_types.ProgrammableTransactionBuilder
func (*ProgrammableTransactionBlock) Client ¶
func (ptb *ProgrammableTransactionBlock) Client() *SuiClient
func (*ProgrammableTransactionBlock) Context ¶
func (ptb *ProgrammableTransactionBlock) Context() context.Context
func (*ProgrammableTransactionBlock) FinishFromMultisig ¶
func (ptb *ProgrammableTransactionBlock) FinishFromMultisig() ([]byte, error)
func (*ProgrammableTransactionBlock) FinishFromSigner ¶
func (ptb *ProgrammableTransactionBlock) FinishFromSigner() ([]byte, error)
func (*ProgrammableTransactionBlock) NewMoveCall ¶
func (*ProgrammableTransactionBlock) ParseFunctionArguments ¶
func (ptb *ProgrammableTransactionBlock) ParseFunctionArguments(target string, args []interface{}) (arguments []sui_types.Argument, err error)
txContext should be nil
type PubkeyEnumWeightPair ¶
type SignaturePubkeyPair ¶
func FromSerializedSignature ¶
func FromSerializedSignature(serializedSignature string) (*SignaturePubkeyPair, error)
type SuiClient ¶
type SuiClient struct { Provider *sdk_client.Client SuiSigner *SuiSigner MultiSig *SuiMultiSig GasBudget *big.Int // contains filtered or unexported fields }
func InitClient ¶
func InitClient(ctx context.Context, suiApi *sdk_client.Client) *SuiClient
Create New Sui Client
func (*SuiClient) AutoUpdateGas ¶
func (cli *SuiClient) AutoUpdateGas(owner string, gas *SuiGasObject)
func (*SuiClient) DevInspect ¶
func (*SuiClient) EnableAutoUpdateGasObjectFromMultiSig ¶
func (client *SuiClient) EnableAutoUpdateGasObjectFromMultiSig()
func (*SuiClient) EnableAutoUpdateGasObjectFromSigner ¶
func (client *SuiClient) EnableAutoUpdateGasObjectFromSigner()
func (*SuiClient) ExecuteTransaction ¶
func (*SuiClient) GetAllCoins ¶
Instance Get All Sui Coins
func (*SuiClient) GetCoins ¶
func (client *SuiClient) GetCoins(owner, coinType string, nextCursor *move_types.AccountAddress) (ret *types.Page[types.Coin, move_types.AccountAddress], err error)
func (*SuiClient) GetFunctionArgumentTypes ¶
func (*SuiClient) GetMaxCoinObject ¶
func (*SuiClient) GetObject ¶
func (client *SuiClient) GetObject(objectId string) (*types.SuiObjectResponse, error)
GET OBJECT/MULTI_OBJECTS
func (*SuiClient) GetObjects ¶
func (client *SuiClient) GetObjects(objectIds []string) ([]types.SuiObjectResponse, error)
func (*SuiClient) ImplementationOfDevInspect ¶
func (client *SuiClient) ImplementationOfDevInspect(txBytes string) (*types.DevInspectResults, error)
func (*SuiClient) MoveCallFromSigner ¶
func (*SuiClient) NewMoveCall ¶
func (client *SuiClient) NewMoveCall(signer, gas, target string, args []interface{}, typeArgs []string) (*types.TransactionBytes, error)
Instance: Move Call
func (*SuiClient) NewMoveCallFromMultiSig ¶
func (*SuiClient) NewMoveCallFromSigner ¶
func (*SuiClient) NewMultiSig ¶
func (client *SuiClient) NewMultiSig(multisig *SuiMultiSig)
func (*SuiClient) NewProgrammableTransactionBlock ¶
func (client *SuiClient) NewProgrammableTransactionBlock(ctx context.Context) *ProgrammableTransactionBlock
func (*SuiClient) SetDefaultGasBudget ¶
func (*SuiClient) SetDefaultGasObjectToMultiSig ¶
func (*SuiClient) SetDefaultGasObjectToSigner ¶
Tools
type SuiGasObject ¶
type SuiMultiSig ¶
type SuiMultiSig struct { Threshold uint16 Address string PublicKeyMap []SuiPubkeyWeightPair Gas *SuiGasObject }
func NewSuiMultiSig ¶
func NewSuiMultiSig(pubKeys []string, weights []uint8, threshold uint16) (*SuiMultiSig, error)
func (*SuiMultiSig) CombineSignatures ¶
func (m *SuiMultiSig) CombineSignatures(signatures []string) (string, error)
func (*SuiMultiSig) Info ¶
func (m *SuiMultiSig) Info() *SuiMultiSigInfo
func (*SuiMultiSig) ToMultiSigAddress ¶
func (m *SuiMultiSig) ToMultiSigAddress() (string, error)
type SuiMultiSigInfo ¶
type SuiMultiSigInfo struct { Address string Threshold uint16 Signers []SuiMultiSigInfoSigner }
type SuiMultiSigInfoSigner ¶
type SuiNetwork ¶
type SuiNetwork = string
var ( MainnetFullNode SuiNetwork = "https://fullnode.mainnet.sui.io:443/" TestnetFullNode SuiNetwork = "https://fullnode.testnet.sui.io:443/" DevnetFullNode SuiNetwork = "https://fullnode.devnet.sui.io:443/" )
type SuiPubkeyWeightPair ¶
type SuiSignedDataRet ¶
type SuiSignedMessageRet ¶
type SuiSignedMessageRet = SuiSignedDataRet
type SuiSignedTransactionRet ¶
type SuiSignedTransactionRet = SuiSignedDataRet
type SuiSigner ¶
type SuiSigner struct { Signer *account.Account Gas *SuiGasObject }
func NewSuiSignerFromBase64PrivateKey ¶
Create New Signer
func NewSuiSignerFromSeed ¶
func (*SuiSigner) GetAddress ¶
func (*SuiSigner) SignMessage ¶
func (s *SuiSigner) SignMessage(data string, scope IntentScope) (*SuiSignedDataRet, error)
func (*SuiSigner) SignMessageBytes ¶
func (s *SuiSigner) SignMessageBytes(data []byte) (*SuiSignedDataRet, error)
func (*SuiSigner) SignPersonalMessage ¶
func (s *SuiSigner) SignPersonalMessage(message string) (*SuiSignedMessageRet, error)
func (*SuiSigner) SignTransaction ¶
func (s *SuiSigner) SignTransaction(b64TxBytes string) (*SuiSignedTransactionRet, error)
Click to show internal directories.
Click to hide internal directories.