Documentation
¶
Index ¶
- Constants
- func AddStake(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (string, error)
- func AddStakePayload(poolAddress string, amount uint64) (aptos_types.TransactionPayload, error)
- func BuildMultiAgentTx(sender string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (rawTxnImpl *v2.RawTransactionWithData, err error)
- func BuildScriptPayload(payload string) (*v2.TransactionPayload, error)
- func BuildSignedTransaction(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (string, error)
- func BuildSignedTransactionV2(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (string, error)
- func BuildTransferWithFeePayerTx(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (*v2.RawTransactionWithData, error)
- func ClaimNFTTokenPayload(sender string, creator string, collectionName string, tokenName string, ...) aptos_types.TransactionPayload
- func CoinBurnPayload(amount uint64, tyArg string) (aptos_types.TransactionPayload, error)
- func CoinMintPayload(receiveAddress string, amount uint64, tyArg string) (aptos_types.TransactionPayload, error)
- func CoinRegisterPayload(tyArg string) (aptos_types.TransactionPayload, error)
- func CoinTransferPayload(to string, amount uint64, tyArg string) (aptos_types.TransactionPayload, error)
- func CoinTransferPayloadV2(to string, amount uint64, tyArg string) (aptos_types.TransactionPayload, error)
- func ConvertArgs(args []interface{}, argTypes []aptos_types.MoveType) ([][]byte, error)
- func ConvertToBigInt(v string) *big.Int
- func DecodeHexStringErr(hexString string) ([]byte, error)
- func DeserializeMultiAgentTransaction(data []byte) (*v2.RawTransactionWithData, error)
- func ExpandAddress(address string) string
- func GetAddressByPubKey(pubKeyHex string, shortEnable bool) (string, error)
- func GetRandomPrivateKey() (string, error)
- func GetRawTxHash(rawTxn *aptos_types.RawTransaction) (string, error)
- func GetSigningData(rawTxnImpl interface{}) (data []byte, err error)
- func GetSigningHash(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (string, error)
- func GetTransactionHash(hexStr string) string
- func Interface2U64(value interface{}) (uint64, error)
- func Interface2U128(value interface{}) (*serde.Uint128, error)
- func MakeMultiAgentTransactionV2(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (*v2.RawTransactionWithData, error)
- func MakeRawTransaction(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (*aptos_types.RawTransaction, error)
- func MakeRawTransactionV2(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (*v2.RawTransaction, error)
- func NewAddress(seedHex string, shortEnable bool) string
- func NewAddressFromPubkey(pubkeyHex string) (addr string, err error)
- func NewPubKeyAddress(pubHex string, shortEnable bool) (string, error)
- func NewTxFromParam(txParam *AptosTXParam) (tx *v2.RawTransaction, err error)
- func NewTxFromRaw(rawTx string, isMultiAgent bool) (tx interface{}, err error)
- func OfferNFTTokenPayload(receiver string, creator string, collectionName string, tokenName string, ...) aptos_types.TransactionPayload
- func PayloadFromJsonAndAbi(payload string, abi string) (aptos_types.TransactionPayload, error)
- func PayloadFromJsonAndAbiV2(payload string, abi string, options ...any) (*v2.TransactionPayload, error)
- func PayloadFromSerializedHex(serializedHex string) (*v2.TransactionPayload, error)
- func ReactivateStake(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (string, error)
- func ReactivateStakePayload(poolAddress string, amount uint64) (aptos_types.TransactionPayload, error)
- func ShortenAddress(address string) string
- func SignAsFeePayer(rawTxn, seedHex string, feePayer string) (string, string, error)
- func SignMessage(priKey, message string) (string, error)
- func SignMultiAgentTx(rawTxn, seedHex string) (string, error)
- func SignRawTransaction(rawTxn *aptos_types.RawTransaction, seedHex string) (string, error)
- func SignRawTransactionV2(rawTxn *v2.RawTransaction, seedHex string) (string, error)
- func SignSimpleTx(rawTxn, seedHex string) (string, error)
- func SignedTx(rawTxn *aptos_types.RawTransaction, signDataHex string, pubKey string) (string, error)
- func SimulateTransaction(rawTxn *aptos_types.RawTransaction, seedHex string) (string, error)
- func String2U128(str string) (*serde.Uint128, error)
- func StripAptosPrivateKeyPrefix(privateKey string) string
- func ToFinalMultiAgentTx(txWithAuth *TxWithAuth) (string, error)
- func Transfer(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (string, error)
- func TransferCoins(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (string, error)
- func TransferPayload(to string, amount uint64) (aptos_types.TransactionPayload, error)
- func Unlock(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (string, error)
- func UnlockPayload(poolAddress string, amount uint64) (aptos_types.TransactionPayload, error)
- func V2CoinTransferPayload(to string, amount uint64, tyArg string) (*v2.EntryFunction, error)
- func ValidateAddress(address string, shortEnable bool) bool
- func ValidateContractAddress(address string) bool
- func VerifyMessage(publicKey, message, signature string) error
- func Withdraw(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (string, error)
- func WithdrawPayload(poolAddress string, amount uint64) (aptos_types.TransactionPayload, error)
- type AptosTXParam
- type ScriptArgument
- type ScriptParam
- type TxWithAuth
- func SignTxV2(rawTxnImpl *v2.RawTransactionWithData, seedHex string) (*TxWithAuth, error)
- func TransferCoinsWithPayer(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (*TxWithAuth, error)
- func TransferWithFeePayer(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, ...) (*TxWithAuth, error)
- func (self *TxWithAuth) GetAdditionalAuthsHex() ([]string, error)
- func (self *TxWithAuth) GetFeePayerAuthHex() (string, error)
- func (self *TxWithAuth) GetRawTxnHex() (string, error)
- func (self *TxWithAuth) GetSenderAuthHex() (string, error)
- func (self *TxWithAuth) MarshalJson() (string, error)
- func (self *TxWithAuth) UnmarshalJson(dataJson string) error
- type TxWithAuthJson
Constants ¶
const ( PrivateKeyEd25519Prefix = "ed25519-priv-" PrivateKeyVariantSecp256k1 = "secp256k1-priv-" )
const HexPrefix = "0x"
Variables ¶
This section is empty.
Functions ¶
func AddStake ¶
func AddStake(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, expirationTimestampSecs uint64, chainId uint8, poolAddress string, amount uint64, seedHex string) (string, error)
Staking related
func AddStakePayload ¶
func AddStakePayload(poolAddress string, amount uint64) (aptos_types.TransactionPayload, error)
func BuildMultiAgentTx ¶
func BuildScriptPayload ¶
func BuildScriptPayload(payload string) (*v2.TransactionPayload, error)
func BuildSignedTransaction ¶
func ClaimNFTTokenPayload ¶
func ClaimNFTTokenPayload(sender string, creator string, collectionName string, tokenName string, propertyVersion uint64) aptos_types.TransactionPayload
func CoinBurnPayload ¶
func CoinBurnPayload(amount uint64, tyArg string) (aptos_types.TransactionPayload, error)
func CoinMintPayload ¶
func CoinMintPayload(receiveAddress string, amount uint64, tyArg string) (aptos_types.TransactionPayload, error)
func CoinRegisterPayload ¶
func CoinRegisterPayload(tyArg string) (aptos_types.TransactionPayload, error)
func CoinTransferPayload ¶
func CoinTransferPayload(to string, amount uint64, tyArg string) (aptos_types.TransactionPayload, error)
func CoinTransferPayloadV2 ¶
func CoinTransferPayloadV2(to string, amount uint64, tyArg string) (aptos_types.TransactionPayload, error)
func ConvertArgs ¶
func ConvertArgs(args []interface{}, argTypes []aptos_types.MoveType) ([][]byte, error)
func ConvertToBigInt ¶
func DecodeHexStringErr ¶
func DeserializeMultiAgentTransaction ¶
func DeserializeMultiAgentTransaction(data []byte) (*v2.RawTransactionWithData, error)
DeserializeMultiAgentTransaction deserializes a BCS encoded MultiAgent transaction
func ExpandAddress ¶
func GetAddressByPubKey ¶
func GetRandomPrivateKey ¶
func GetRawTxHash ¶
func GetRawTxHash(rawTxn *aptos_types.RawTransaction) (string, error)
func GetSigningData ¶
func GetSigningHash ¶
func GetTransactionHash ¶
pub enum Transaction { /// Transaction submitted by the user. e.g: P2P payment transaction, publishing module /// transaction, etc. /// TODO: We need to rename SignedTransaction to SignedUserTransaction, as well as all the other /// transaction types we had in our codebase. UserTransaction(SignedTransaction),
/// Transaction that applies a WriteSet to the current storage, it's applied manually via db-bootstrapper. GenesisTransaction(WriteSetPayload),
/// Transaction to update the block metadata resource at the beginning of a block. BlockMetadata(BlockMetadata),
/// Transaction to let the executor update the global state tree and record the root hash /// in the TransactionInfo /// The hash value inside is unique block id which can generate unique hash of state checkpoint transaction StateCheckpoint(HashValue), }
func Interface2U64 ¶
func Interface2U128 ¶
func MakeRawTransaction ¶
func MakeRawTransaction(from string, sequenceNumber uint64, maxGasAmount uint64, gasUnitPrice uint64, expirationTimestampSecs uint64, chainId uint8, payload aptos_types.TransactionPayload) (*aptos_types.RawTransaction, error)
func MakeRawTransactionV2 ¶
func NewAddress ¶
func NewAddressFromPubkey ¶
func AddSignature(tx Transaction, sig []byte) (data TxData, err error)
func NewTxFromParam ¶
func NewTxFromParam(txParam *AptosTXParam) (tx *v2.RawTransaction, err error)
func NewTxFromRaw ¶
todo
func OfferNFTTokenPayload ¶
func OfferNFTTokenPayload(receiver string, creator string, collectionName string, tokenName string, propertyVersion uint64, amount uint64) aptos_types.TransactionPayload
func PayloadFromJsonAndAbi ¶
func PayloadFromJsonAndAbi(payload string, abi string) (aptos_types.TransactionPayload, error)
func PayloadFromJsonAndAbiV2 ¶
func PayloadFromSerializedHex ¶
func PayloadFromSerializedHex(serializedHex string) (*v2.TransactionPayload, error)
func ReactivateStake ¶
func ReactivateStakePayload ¶
func ReactivateStakePayload(poolAddress string, amount uint64) (aptos_types.TransactionPayload, error)
func ShortenAddress ¶
func SignAsFeePayer ¶
func SignMessage ¶
func SignMultiAgentTx ¶
func SignRawTransaction ¶
func SignRawTransaction(rawTxn *aptos_types.RawTransaction, seedHex string) (string, error)
func SignRawTransactionV2 ¶
func SignRawTransactionV2(rawTxn *v2.RawTransaction, seedHex string) (string, error)
func SignSimpleTx ¶
func SignedTx ¶
func SignedTx(rawTxn *aptos_types.RawTransaction, signDataHex string, pubKey string) (string, error)
func SimulateTransaction ¶
func SimulateTransaction(rawTxn *aptos_types.RawTransaction, seedHex string) (string, error)
func ToFinalMultiAgentTx ¶
func ToFinalMultiAgentTx(txWithAuth *TxWithAuth) (string, error)
func TransferCoins ¶
func TransferPayload ¶
func TransferPayload(to string, amount uint64) (aptos_types.TransactionPayload, error)
func UnlockPayload ¶
func UnlockPayload(poolAddress string, amount uint64) (aptos_types.TransactionPayload, error)
func V2CoinTransferPayload ¶
func ValidateAddress ¶
func ValidateContractAddress ¶
func VerifyMessage ¶
func WithdrawPayload ¶
func WithdrawPayload(poolAddress string, amount uint64) (aptos_types.TransactionPayload, error)
Types ¶
type AptosTXParam ¶
type AptosTXParam struct {
From string `json:"from"`
SequenceNumber uint64 `json:"sequenceNumber"`
MaxGasAmount uint64 `json:"maxGasAmount"`
GasUnitPrice uint64 `json:"gasUnitPrice"`
ExpirationTimestampSecs uint64 `json:"expirationTimestampSecs"`
ChainId uint8 `json:"chainId"`
Payload string `json:"payload"`
}
type ScriptArgument ¶
type ScriptArgument struct {
Variant v2.ScriptArgumentVariant `json:"variant"` // The type of the argument
Value string `json:"value"` // The value of the argument
}
ScriptArgument a Move script argument, which encodes its type with it
type ScriptParam ¶
type ScriptParam struct {
Code string `json:"code"` // The compiled script bytes, hex
ArgTypes []string `json:"argTypes"` // The types of the arguments
Args []string `json:"args"` // The arguments
}
Script A Move script as compiled code as a transaction
type TxWithAuth ¶
type TxWithAuth struct {
RawTxn *v2.RawTransactionWithData `json:"rawTxn"`
SenderAuth *crypto.AccountAuthenticator `json:"senderAuth"`
FeePayerAuth *crypto.AccountAuthenticator `json:"feePayerAuth"`
AdditionalAuths []crypto.AccountAuthenticator `json:"additionalAuths"`
}
func SignTxV2 ¶
func SignTxV2(rawTxnImpl *v2.RawTransactionWithData, seedHex string) (*TxWithAuth, error)
func TransferCoinsWithPayer ¶
func TransferWithFeePayer ¶
func (*TxWithAuth) GetAdditionalAuthsHex ¶
func (self *TxWithAuth) GetAdditionalAuthsHex() ([]string, error)
func (*TxWithAuth) GetFeePayerAuthHex ¶
func (self *TxWithAuth) GetFeePayerAuthHex() (string, error)
func (*TxWithAuth) GetRawTxnHex ¶
func (self *TxWithAuth) GetRawTxnHex() (string, error)
func (*TxWithAuth) GetSenderAuthHex ¶
func (self *TxWithAuth) GetSenderAuthHex() (string, error)
func (*TxWithAuth) MarshalJson ¶
func (self *TxWithAuth) MarshalJson() (string, error)
func (*TxWithAuth) UnmarshalJson ¶
func (self *TxWithAuth) UnmarshalJson(dataJson string) error
Directories
¶
| Path | Synopsis |
|---|---|
|
internal/types
Package types is an internal package that contains the types used in the Aptos Go SDK.
|
Package types is an internal package that contains the types used in the Aptos Go SDK. |