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) (*client.Client, error)
- func NewSuiProviderFromNetwork(network SuiNetwork) (*client.Client, error)
- func ParseSignatureScheme(scheme byte) string
- func SuiPrivateKeyToB64(pk string) (string, error)
- func ToSerializedSignature(signature, pubKey []byte) string
- func UnmarshalSuiBCS(data []byte, v any) error
- 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 Decoder
- type IntentScope
- type MultiSigPublicKeyStruct
- type MultiSigStruct
- type PubkeyEnumWeightPair
- type SignaturePubkeyPair
- type SuiAddress
- type SuiClient
- func (cli *SuiClient) AutoUpdateGas(owner string, gas *SuiGasObject)
- func (cli *SuiClient) DevInspect(ctx context.Context, target string, args []interface{}, ...) (*types.DevInspectResults, error)
- func (cli *SuiClient) EnableAutoUpdateGasObjectFromMultiSig()
- func (cli *SuiClient) EnableAutoUpdateGasObjectFromSigner()
- func (cli *SuiClient) ExecuteTransaction(ctx context.Context, b64TxBytes string, signatures []any) (*types.SuiTransactionBlockResponse, error)
- func (cli *SuiClient) GetAllCoins(ctx context.Context, owner string, coinType string) (data []types.Coin, err error)
- func (cli *SuiClient) GetCoins(ctx context.Context, owner, coinType string, ...) (ret *types.Page[types.Coin, move_types.AccountAddress], err error)
- func (cli *SuiClient) GetFunctionArgTypes(ctx context.Context, target string) (*[]interface{}, error)
- func (cli *SuiClient) GetMaxCoinObject(ctx context.Context, address, coinType string) (*types.Coin, error)
- func (cli *SuiClient) GetMoveFunctionArgTypes(ctx context.Context, packageId, module, function string) (*[]interface{}, error)
- func (cli *SuiClient) GetObject(ctx context.Context, objectId string) (*types.SuiObjectResponse, error)
- func (cli *SuiClient) ImplementationOfDevInspect(ctx context.Context, txBytes string) (*types.DevInspectResults, error)
- func (cli *SuiClient) MoveCallFromSigner(ctx context.Context, target string, args []interface{}, typeArgs []string) (result *types.SuiTransactionBlockResponse, err error)
- func (cli *SuiClient) NewMoveCall(ctx context.Context, signer, gas, target string, args []interface{}, ...) (*types.TransactionBytes, error)
- func (cli *SuiClient) NewMoveCallFromMultiSig(ctx context.Context, target string, args []interface{}, typeArgs []string) (*types.TransactionBytes, error)
- func (cli *SuiClient) NewMoveCallFromSigner(ctx context.Context, target string, args []interface{}, typeArgs []string) (*types.TransactionBytes, error)
- func (cli *SuiClient) NewProgrammableTransactionMoveCall(ctx context.Context, builder *sui_types.ProgrammableTransactionBuilder, ...) (*sui_types.Argument, error)
- func (cli *SuiClient) NewSuiMultiSig(multisig *SuiMultiSig)
- func (cli *SuiClient) NewSuiSigner(signer *SuiSigner)
- func (cli *SuiClient) ParseFunctionArgs(ctx context.Context, target string, args []interface{}) (ret []sui_types.CallArg, err error)
- func (cli *SuiClient) ProgrammableTransactionFinishFromMultisig(ctx context.Context, builder *sui_types.ProgrammableTransactionBuilder) ([]byte, error)
- func (cli *SuiClient) ProgrammableTransactionFinishFromSigner(ctx context.Context, builder *sui_types.ProgrammableTransactionBuilder) ([]byte, error)
- func (cli *SuiClient) SetDefaultGasBudget(budget *big.Int)
- func (cli *SuiClient) SetMultiSigDefaultGasObject(obj string)
- func (cli *SuiClient) SetSignerDefaultGasObject(obj string)
- func (cli *SuiClient) TryDevInspect(ctx context.Context, target string, args []sui_types.CallArg, ...) (*types.DevInspectResults, error)
- 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)
- type VectorAddress
- type VectorBigInt
- type VectorU16
- type VectorU32
- type VectorU64
- type VectorU8
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 NewSuiProviderFromNetwork ¶
func NewSuiProviderFromNetwork(network SuiNetwork) (*client.Client, error)
Create New Provider
func ParseSignatureScheme ¶
func SuiPrivateKeyToB64 ¶
func ToSerializedSignature ¶
func UnmarshalSuiBCS ¶ added in v0.100.11
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 Decoder ¶ added in v0.100.10
type Decoder struct {
// contains filtered or unexported fields
}
func NewSuiBCSDecoder ¶ added in v0.100.11
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 PubkeyEnumWeightPair ¶
type SignaturePubkeyPair ¶
func FromSerializedSignature ¶
func FromSerializedSignature(serializedSignature string) (*SignaturePubkeyPair, error)
type SuiAddress ¶ added in v0.100.0
type SuiAddress = string
type SuiClient ¶
type SuiClient struct { Provider *client.Client SuiSigner *SuiSigner MultiSig *SuiMultiSig GasBudget *big.Int }
func InitSuiClient ¶ added in v0.100.0
Create New Sui Client
func (*SuiClient) AutoUpdateGas ¶
func (cli *SuiClient) AutoUpdateGas(owner string, gas *SuiGasObject)
func (*SuiClient) DevInspect ¶
func (cli *SuiClient) DevInspect(ctx context.Context, target string, args []interface{}, argsType []move_types.TypeTag) (*types.DevInspectResults, error)
func (*SuiClient) EnableAutoUpdateGasObjectFromMultiSig ¶
func (cli *SuiClient) EnableAutoUpdateGasObjectFromMultiSig()
func (*SuiClient) EnableAutoUpdateGasObjectFromSigner ¶
func (cli *SuiClient) EnableAutoUpdateGasObjectFromSigner()
func (*SuiClient) ExecuteTransaction ¶
func (*SuiClient) GetAllCoins ¶
func (cli *SuiClient) GetAllCoins(ctx context.Context, owner string, coinType string) (data []types.Coin, err error)
Instance Get All Sui Coins
func (*SuiClient) GetCoins ¶
func (cli *SuiClient) GetCoins(ctx context.Context, owner, coinType string, nextCursor *move_types.AccountAddress) (ret *types.Page[types.Coin, move_types.AccountAddress], err error)
func (*SuiClient) GetFunctionArgTypes ¶ added in v0.100.0
func (*SuiClient) GetMaxCoinObject ¶
func (*SuiClient) GetMoveFunctionArgTypes ¶ added in v0.100.0
func (*SuiClient) ImplementationOfDevInspect ¶
func (*SuiClient) MoveCallFromSigner ¶
func (*SuiClient) NewMoveCall ¶
func (cli *SuiClient) NewMoveCall(ctx context.Context, signer, gas, target string, args []interface{}, typeArgs []string) (*types.TransactionBytes, error)
Instance: Move Call
func (*SuiClient) NewMoveCallFromMultiSig ¶
func (*SuiClient) NewMoveCallFromSigner ¶
func (*SuiClient) NewProgrammableTransactionMoveCall ¶ added in v0.100.0
func (*SuiClient) NewSuiMultiSig ¶ added in v0.100.0
func (cli *SuiClient) NewSuiMultiSig(multisig *SuiMultiSig)
func (*SuiClient) NewSuiSigner ¶ added in v0.100.0
func (*SuiClient) ParseFunctionArgs ¶ added in v0.100.0
func (*SuiClient) ProgrammableTransactionFinishFromMultisig ¶ added in v0.100.0
func (*SuiClient) ProgrammableTransactionFinishFromSigner ¶ added in v0.100.0
func (*SuiClient) SetDefaultGasBudget ¶
func (*SuiClient) SetMultiSigDefaultGasObject ¶ added in v0.100.0
func (*SuiClient) SetSignerDefaultGasObject ¶ added in v0.100.0
Tools
func (*SuiClient) TryDevInspect ¶ added in v0.100.0
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)
type VectorAddress ¶ added in v0.100.0
type VectorAddress struct {
Data []SuiAddress
}
func (*VectorAddress) Marshal ¶ added in v0.100.0
func (v *VectorAddress) Marshal() (buf []byte, err error)
type VectorBigInt ¶ added in v0.100.0
func (*VectorBigInt) Marshal ¶ added in v0.100.0
func (v *VectorBigInt) Marshal() (buf []byte, err error)
Click to show internal directories.
Click to hide internal directories.